I am using a tool called giswater to model our water sewer and storm networks. The tools builds a database from a few simple inputs in a gui one of which is the SRID. the geometry columns are all xy and I want to make them all ZM aware. When I run the alter table command to update the geometry I get an error "Cannot alter column participating in a view or rule" Anyway to force this change and ignore the error? I tried changing the view to not reference the column and I tried adding a new geometry column to switch the view to temporarily while I make the change. Apparently I cannot drop a column in a view or change it to another column. I also tried writing the schema to SQL then edited the sql lines for linestring and point to linestringzm and pointzm and using psql to run the file to update the schema; all I get is access denied using "psql -U postgres -d utility -1 -f \i Z:......\xyz_test.sql" Also tried pg_restore. Anyway to just force the change using pg_admin4? or other suggestions?
Change a column participating in a view or rule
414 Views Asked by MrKingsley At
1
There are 1 best solutions below
Related Questions in POSTGRESQL
- Only the first SQL script gets executed inside Docker Postgres container
- Compare fields in two tables
- Hibernate ClobJdbcType bindings: what are the diferences?
- Postgres && statement Error in Mybatis Mapper?
- Can this query be optimized? (Choosing a random row to insert, that excludes previously inserted Rows)
- Connection terminated unexpectedly while performing multi row insert using pg-promise
- Processing multiple forms in nodejs and postgresql
- How to copy data from SQLite to postgreSQL?
- PGAdmin4 configured behind a reverse proxy but unable to connect to Postgresql server
- Updates to pgsodium encrypted values don't use specified key_id
- Connecting to Postgres running in a Docker container using psql
- Can't connect to local postgresql server from my docker container
- Django Arrayfield migration to cloud sql (Postgresql) not creating the column
- Get list of matching keywords for each post
- docker-compose can't reset postgresql database
Related Questions in POSTGIS
- Connecting to Postgres running in a Docker container using psql
- Publishing PostGIS-Raster Using Mapserver
- PostgreSQL: Speed Up Updating a Column using Aggregate Value from Another Column
- Getting inner holes in a multipolygon using PostGis
- How to select all groups of intersecting polygons from a single table using PostGIS
- Polygon overlap queries very slow
- North/South/East/West coordinate in postgis to use with st_contains
- Prepopulating PostGIS with OSM data works with Docker Desktop, but not with Azure pipeline
- TypeORM/NestJS "type "geography" does not exist" when running tests
- Failure to retrieve PostGIS Geometry with Go `orb` and `wkb`
- Defining a unique key on a PostGIS table
- fill psql db -> current transaction is aborted, commands ignored until end of transaction block
- Postgresql: create index issue"Index row requires 23653 maximum size 8191" error 54000
- I have Shape Area and Shape Length of a polygon shapefile. How can I convert these to geometries in PostgreSQL?
- Optimising neighbour query in postgis
Related Questions in ALTER-TABLE
- I can't perform database migrations. I'm using PostGreSQL. See the error it gives me:
- Issue with CREATE UPDATE TABLE in MSSQL with db_ddladmin permission
- MySQL find out foreign key constraint on column
- Is it possible with SQL to get all tables from a database using LIKE and then change column size in them all
- Can I prepare "ALTER TABLE ? RENAME TO ?;" in SQLite?
- How can i do to show up the text when i want to alter table from my mysql workbench app?
- Is it valid to use only modify not "modify column" in mysql
- PostgreSQL: what's the difference between "alter table ... add unique (...)" and "alter table ... add constraint ... unique (...)"?
- Does MySql ALTER TABLE command affects rows?
- Alter column type from text[] to jsonb[]
- How to change the description of a field nested in a struct via the DDL in BigQuery?
- ALTER TABLE WITH SELECT
- Altering column data type
- ERROR: ALTER TABLE APPEND cannot run inside a multiple commands statement
- Unanticipated Index Creation in MSSQL and its Impact on Column Alteration - INDEX_VV_<3to4DigitNumber>_<3to4DigitNumber>
Related Questions in ALTER-COLUMN
- Need to Alter data type in a column common to all tables in a schema
- How to change/alter the data type of a column from a table which has a custom data type in POSTGRESQL?
- ALTER COLUMN TYPE from tinyInt to Varchar in Mysql
- Why can't I convert a column from one enum to another?
- Unable to change my time column from string to time in Bigquery
- Altering Column Type in SQL (PGadmin) not working
- SQL Server - Alter column length causes collateral damage?
- how to set maximum length to int data type in sql
- MySQL Error 1366 when trying to change column data type to INT
- Alter column type deleting those that can't be converted
- Why is the column not altering when I try to convert it to UUID?
- Altering data types of all columns in a table (PostgreSQL 13)
- POSTGRESQL convert date to unix timestamp int
- Missing Expression when Alter Default on NULL 1
- How can I change the precision of a datetime2 for a system-versioned table (temporal table) in SQL Server?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I am not familiar with the tool you are using but I would suggest checking all the objects (views and rules) referencing your table by using the below command.
SELECT DISTINCT so.name FROM syscomments sc INNER JOIN sysobjects so ON sc.id=so.id WHERE sc.TEXT LIKE '%tablename%'
Then backing up these object and dropping them completely before attempting to alter the table.