How to get the primary key fields from a postgres table

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for PostgreSQL in Delphi and C++Builder
Post Reply
genriquez
Posts: 6
Joined: Tue 27 Nov 2012 17:26

How to get the primary key fields from a postgres table

Post by genriquez » Thu 22 Aug 2013 04:05

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.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

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

Post by AlexP » Thu 22 Aug 2013 09:17

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.

Post Reply