- Daniel Vivier
- PowerBuilder
- Friday, 4 August 2017 10:19 PM UTC
I'm working on a port of my PB2017 version of my app to PostgreSQL. I have updated all copies of the PBODB170.INI file to include the following sections (irrelevant bits omitted):
[PostgreSQL]
PBSyntax='PGSQL_SYNTAX'
PBTableOwner='NO'
...
PBNoCatalog='YES'
[PGSQL_SYNTAX]
...
GetIdentity="Select currval('GEN_&TableName')"
I am quite sure this section is being found, because before I added this section, every time I connected in PB to Postgres I was warned about the fact that the catalog tables couldn't be created. Now I'm not warned about that. (So that's the PBNoCatalog setting working.)
However, in DWs with Identity Columns, the identity value isn't being retrieved properly after an Update. I'm quite sure from the Postgres docs that the syntax for GetIdentity in the code above is good.
I've tested this in the DB painter, to make sure my DDL is correct in that it is correctly using a SEQUENCE to insert the identity values. To test that, I did an INSERT statement to insert a row (with no identity column value), did a SELECT to retrieve that row and saw that the identity column was filled in, and did the Select currval('GEN_...') which correctly returned that same identity column I saw in the SELECT of the row itself.
So, any bright ideas of what I might be missing here? Thanks.
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.