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
- Why does adding a JOIN completely modify the query planner behaviour?
- When dealing with databases, does adding a different table when we can use a simple hash a good thing?
- Aggregate and count in PostgreSQL
- Rails HABTM: Select everything a that a record 'has'
- Trigger using data from inserted row
- Select results where joined table contains records with an attribute, but without another
- DB candidate as CouchDB/Schema replacement
- How do I properly add data in SQLAlchemy?
- Postgres in Conda Environment (Ubuntu 14.04)
- How to customize the output of the Postgres Pseudo Encrypt function?
- Split a large query (2 days) into pieces to increase the speed in Postgres
- Why does pg_search prefix not work like I expect?
- extracting meta info from a table psql using information_schema
- How to query a table in the database and copy it's data into one one?
- Update a table using info from a second table and a condition from a third table in Postgresql
Related Questions in POSTGIS
- Play Framework Unable to build entity manager factory when Working with PostGIS
- ST_SetSRID ST_Point PostGIS giving strange output
- Create a Geoserver layer with data from a Postgis SQL view with Python/gsconfig
- NoMethodError using activerecord_postgis_adapter
- Access PostGIS functions in PyCharm Database Navigator
- how to detect polygons within other (many) polygons in postgis
- iterate and write separately linestrings (generate_series)
- What is wrong with this ST_CONTAINS statement PostGIS - Find point in polygon
- Accurate Bounding Box From Geography Polygon
- Getting Postgis/JDBC to work with BoneCP in Spring
- How do you pass in timestamp variable into JDBC request for jmeter
- PostGIS only works with root user
- Symbol not found - POSTGIS on PostgreSQL 9.3.3 Mac OS X 10.10
- Cannot CREATE EXTENSION postgis, $libdir/postgis-2.1 not found
- Using psql options in npgsql
Related Questions in ALTER-TABLE
- SQL Invalid ALTER TABLE option
- How to add a (primary) key to an existing table using SAP HANA
- Error when link 2 table in sql server
- ALTER TABLE doesn't work
- ALTER COLUMN when table depends on the column
- How to change date format of datetime data type in SQL?
- How to reorder columns in DataGrip or IntelliJ?
- modify oracle externat table date column format
- MariaDB ALTER TABLE DROP COLUMN infinite
- Using a php foreach loop with ALTER TABLE mysql to update multiple column names
- ALTER TABLEs without AFTER vs ALTER TABLEs with AFTER
- oracle: Add constraint that checks column for existing value
- Using ALTER TABLE command in psql to add to a table
- how to add column to a mysql table by selecting columns from another table
- I want to alter table in php , but my code is not working
Related Questions in ALTER-COLUMN
- How can I ALTER COLUMN to NULL when the column in NOT NULL in Oracle
- ALTER TABLE doesn't work
- ALTER COLUMN when table depends on the column
- MSSQL: alter column not null, in general
- SQL Server 2005 - T-SQL to increase field size based on parameters
- ALTER COLUMN does not seem to convert datatype to LONG
- Why can't I convert a column from one enum to another?
- Unable to change my time column from string to time in Bigquery
- ALTER COLUMN TYPE from tinyInt to Varchar in Mysql
- Change a column to not allow nulls
- MS Access - sql expression for allow null?
- Set IDENTITY to existing column
- HSQLDB (HyperSQL): Changing column type in a TEXT table
- How to ALTER multiple columns at once in SQL Server
- I get "ORA-00900: invalid SQL statement" error while modifying column
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 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.