Hi.

I'm testing the PostgreSQL Con Kit (ODBC) that ships with DF 18.1 and have converted a database. A couple of tables could not be converted and the error for the tables are alike:

Code:
Converting Recnum table: 23, N23, Patient - Journalforside
Start time: 20-09-2015 16:29:54,462
Starting restructure transaction.
Creating new table.
ERROR 12289: General error. 42601 (7)--ERROR: syntax error at or near "DEFAULT";
Error while executing the query  Table = NOVAX23 (0), Source = ODBC_DRV.Structure_End.CreateTable
Rollback restructure transaction.
End time: 20-09-2015 16:29:54,472
Total time to convert table: 0:0:0:0,01
300 out of 304 tables were converted correctly otherwise. It does not matter if I use the Unicode or the ANSI ODBC driver. And as far as I can understand since PostgresSQL v8 the Unicode driver would handle ansi applications automatically. And I get the same result with both drivers so I assume that is correct.

Another problem is now that I can not create new records.

Code:
D:\Udvk171\Anyflex\Programs\Anyflex.exe
Can't create record with recnum zero. Table = LOG (1), Field = RECNUM (0)


Fejl: 12330
Fejlkilde = ODBC_DRV.Save


MSG_UNHANDLEDERRORDISPLAY (6009) - Error_Info_Object (17) - at address 24792
MSG_ERROR_REPORT (433) - Error_Info_Object (17) - at address 24867
MSG_REQUEST_SAVE (375) - oObject (1379) - at address 10335
GET_SAVESELECTEDROW (9950) - oObject (1270) - at address 70892
GET_SAVESELECTEDROW (9950) - oData (1242) - at address 69020
GET_ADDROW (10676) - oData (1242) - at address 68965
MSG_MOVEDOWNROW (9980) - oData (1242) - at address 68769
MSG_MOVEDOWNROW (9980) - oObject (1457) - at address 63340
MSG_PROCESS_ACCELERATOR (455) - oObject (1457) - in native code
[start] - at address 130516
So it seems that auto numbering of recnum tables are not allowed? I had a look at the INT file:

Code:
DRIVER_NAME ODBC_DRV
SERVER_NAME DSN=PostgreSQL30;UID=Novaxuser;PWD=vejl16c
DATABASE_NAME LOG
SCHEMA_NAME public


RECNUM_TABLE YES
PRIMARY_INDEX 0
GENERATE_RECORD_ID_METHOD NONE
TABLE_CHARACTER_FORMAT ANSI
USE_DUMMY_ZERO_DATE YES


INDEX_NUMBER 0
INDEX_NAME log000
Note the highlighted setting. According to the "Understanding How Connectivity Works" this setting is responsible for how identity column is filled. As you can see it is set to "None" by the dbBuilder conversion. This should make the con kit send the recnum value to the backend as the backend does not handle the value. The Primary_Index is also set to 0 (log000) and this index contains recnum.

Do I need to set another setting? Note that I am not able to use the "Identity_Column" value for the "Generate_Record_Id_Method" since that is only supported for MSSQL and DB2. So I can not set any auto numbering feature in PostgreSQL with this "None" setting. But wouldn't that mean that the con. kit. should provide a new recnum value? And how should con. kit. keep track of which number to give the backend? Recnum in DataFlex files are just the physical position of the record so it actually does not exists as an entity. But it does in MSSQL i.e. Identity_Column.