Re: in C trigger function find out if column is part of primary key - Mailing list pgsql-general

From Kevin Grittner
Subject Re: in C trigger function find out if column is part of primary key
Date
Msg-id 1364937443.76835.YahooMailNeo@web162901.mail.bf1.yahoo.com
Whole thread Raw
In response to in C trigger function find out if column is part of primary key  ("Enke, Dr., Michael" <michael.enke@wincor-nixdorf.com>)
List pgsql-general
"Enke, Dr., Michael" <michael.enke@wincor-nixdorf.com> wrote:
> I have to find out if a column ( i = 0, …, tupdesc->natts-1 ) is
> part of a primary key but for performance reasons I do not want
> to execute another query via SPI.  Is this possible?

You might get some inspiration from looking at this bit of code:


http://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=contrib/tcn/tcn.c;h=eb7e1a61a6a1d5c5ed2e840af41410ac4a52418f;hb=master#l127

--
Kevin Grittner
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-general by date:

Previous
From: Joe Van Dyk
Date:
Subject: Re: Using varchar primary keys.
Next
From: Stephen Scheck
Date:
Subject: Dynamic/polymorphic record/composite return types for C user-defined-functions