Applies to: PostgreSQL through the ODBC driver, with File Manager 3 (FM3) creating the column, as reported in 2014. The Clarion version is not named.
Problem
A very old table had a primary key that was not auto-numbered and could be changed by the user, so the poster added a new LONG column recnumb with a unique key. In the dictionary it had AutoNumber 1,1, IsIdentity True and an external name with | READONLY. FM3 created the column and numbered the existing rows, and a sequence existed. Adding a record gave Error: Unsupported File Driver Function (80), on the browse's Insert button with EMULATEAUTONUMKEY set, and on the form's Save button once that option was removed.
Solution
The poster solved it in two steps.
- The table's driver string, held in a variable, had not been updated for the new column. Adding an /AUTOINC clause that reads the sequence value made error 80 go away:
' /AUTOINC=SELECT currval(pg_get_serial_sequence(''myschema.inventry'',''inv_recnumb''))'(appended to the existing driver string). - A duplicate key error followed. FM3 had given the new column a default of 0 instead of the next value of the sequence. He ran two PROP:SQL statements once from his data manager app:
ALTER TABLE ... ALTER COLUMN inv_recnumb SET DEFAULT nextval(...), andSELECT SETVAL(sequence, MAX(inv_recnumb)) FROM table, checking Error() after each.
Caveats
- The posters disagreed on whether a SERIAL type can sit beside an existing primary key: one said it becomes the primary key, another said a table can hold two or more serial columns.
- One poster moved from sequences to GUID keys because restoring from SQL scripts caused trouble with sequences.
- Another suggested a ForceSQLDataType SERIAL option; the thread does not say it was needed.
Today (2026)
Likely still holds for the /AUTOINC and sequence-default parts. Not re-tested.
Sources: Chuck T. (Dec 2014, the question and the solution), JP G., Johan Z., Sean H. (Dec 2014) in softvelocity.clarion.databasedrivers.