Re: Getting Constrint information..?? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Getting Constrint information..??
Date
Msg-id 20155.1019183970@sss.pgh.pa.us
Whole thread Raw
In response to Getting Constrint information..??  (Steffen Nielsen <styf@cs.auc.dk>)
List pgsql-hackers
Steffen Nielsen <styf@cs.auc.dk> writes:
> Can anyone tell me what wrong with the following codesnippet. I nuke the 
> server when called (stored procedure)

> for (i = 1, buf[0] = 0; i <= tupdesc->natts; i++) {                   
>                 ccbin = check[i].ccbin;

Well, for one thing, the number of check[] array entries is probably not
equal to the number of attributes of the relation.  tupconstr->num_check
tells you how many there are.  For another, check[] should be indexed
from 0 not 1 (just like all C arrays).
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: syslog support by default
Next
From: Tom Lane
Date:
Subject: Re: syslog support by default