nasa / CCDD

CFS Command and Data Dictionary Tool (CCDDT)
81 stars 31 forks source link

Invalid SQL command; ERROR: syntax error at or near "OIDS" when opening project #92

Closed tstern-masten closed 3 years ago

tstern-masten commented 3 years ago

Hello,

I am new to CCDD and PostgreSQL in general. Working through the provided tutorial I get the following error attempting to open the project in my terminal.

Command that failed: CREATE TABLE __dbu_info (database_lock text, database_name text, database_users text, database_description text) WITH OIDS; INSERT INTO __dbu_info VALUES ('Core Flight Software Command and Data Dictionary0', 'MyProject', 'tstern', 'Test'); ALTER TABLE __dbu_info OWNER TO tstern; GRANT ALL PRIVILEGES ON TABLE __dbu_info TO GROUP tstern; 
Command that failed: DELETE FROM __dbu_info;
Command that failed: CREATE TABLE __dbu_info (database_lock text, database_name text, database_users text, database_description text) WITH OIDS; INSERT INTO __dbu_info VALUES ('Core Flight Software Command and Data Dictionary0', 'myproject', 'tstern', 'Test'); ALTER TABLE __dbu_info OWNER TO tstern; GRANT ALL PRIVILEGES ON TABLE __dbu_info TO GROUP tstern; 

Digging into logs I see the following complaints as well

|Fail|Cannot create tables and functions in project database 'myproject' as user 'tstern'; cause 'Invalid SQL command; ERROR: syntax error at or near "OIDS"  Position: 119'

I am running on a linux VM and have the following versions:

After doing some digging it appears that the use of OIDS was removed in version 12 of PostGreSQL. I will roll back and try again. Apologies if this is already documented somewhere.

tstern-masten commented 3 years ago

Was able to roll back my postgresql version from 12 to 10 and was able to open the project as expected without errors.

So it seems the solution in the short term is to not use postgresql version 12

CDKnightNASA commented 2 years ago

Given that "with oids" has been deprecated, seems to me this ticket should remain open until CCDD has a fix to support the latest Postgres?

DavidKelly-MDA commented 2 years ago

Agreed. This requires rolling postgres back to a much less secure version.