Re: Getting Constrint information..??

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Steffen Nielsen <styf(at)cs(dot)auc(dot)dk>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Getting Constrint information..??
Date: 2002-04-19 02:39:30
Message-ID: 20155.1019183970@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Steffen Nielsen <styf(at)cs(dot)auc(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-04-19 02:53:38 Re: syslog support by default
Previous Message Tatsuo Ishii 2002-04-19 02:34:19 syslog support by default