Page 1 of 1

How to get the primary key fields from a postgres table

Posted: Thu 22 Aug 2013 04:05
by genriquez
Hi

Someone know how to get the primary key fields from a postgres table?

Im working with Delphi XE2 and XE4, DbExpress DevArtPostgres Driver.

I try with

SqlQuery1.SetSchemaInfo(stIndexes,'MyTable','');
SqlQuery1.Open;

But return a list of indexnames, but not the Primary Key Fields.

Thanks.

Re: How to get the primary key fields from a postgres table

Posted: Thu 22 Aug 2013 09:17
by AlexP
Hello,

We cannot reproduce the problem - when executing the provided code, PK is returned correctly. Please specify your driver version and provide the script for creating the table.