Opened 12 years ago
Closed 12 years ago
#2049 closed defect (wontfix)
populate_geometry_columns: ERROR: cannot alter type of a column used in a trigger definition
Reported by: | strk | Owned by: | |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 2.0.4 |
Component: | postgis | Version: | 2.0.x |
Keywords: | Cc: |
Description
This is the situation: I've a table with a column of type "geometry" which is used in a trigger. There is no constraint on the type of the geometry, but all rows are of type POINT and srid 4326.
I think in normal situation populate_geometry_column() would alter the table to become of type "geometry(point, 4326)" but in this case it would fail with this message:
ERROR: cannot alter type of a column used in a trigger definition
I think it should be fixed in 2.0 by disabling the trigger during the ALTER as we know we're not really altering the value of the geometry but only it's _advertised_ type, right ?
Change History (8)
comment:1 by , 12 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 12 years ago
comment:3 by , 12 years ago
The only thing we could do is:
- Fetch trigger definition
- DROP the trigger
- Run the ALTER TABLE
- CREATE the trigger
comment:4 by , 12 years ago
Owner: | removed |
---|---|
Status: | assigned → new |
comment:5 by , 12 years ago
A close friend of the trigger one:
ERROR: cannot alter type of a column used by a view or rule
comment:6 by , 12 years ago
I think it would be good to only skip the problematic tables rather than throw away the whole transaction, and the code seems to partially do that, but only when the exception thrown is "invalid_parameter_value"
comment:7 by , 12 years ago
Milestone: | PostGIS 2.0.2 → PostGIS 2.0.3 |
---|
We aren't goind to be fiddling with views or triggers. And I'm not going to changing this function in a week to raise a warning.
comment:8 by , 12 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
NOTE: using constraints is not a problem