Re: ADD/DROP constraints

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: ADD/DROP constraints
Date: 2006-06-09 18:26:20
Message-ID: 874pyui3sj.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> I fear you'll have to actually reverse-compile the conbin strings and see if
> you get a match.

There seems to be something I'm missing wrt the conbin string. I have a table
here with a simple check constraint:

Table "public.a"
Column | Type | Modifiers
--------+---------+-----------
i | integer |
Check constraints:
"x" CHECK (i = 0)

But when I loop around looking at the constraints the conbin text field has an
empty string in it:

(gdb) p *con
$2 = {conname = {data = "x", '\0' <repeats 62 times>, alignmentDummy = 120},
connamespace = 2200, contype = 99 'c', condeferrable = 0 '\0',
condeferred = 0 '\0', conrelid = 24661, contypid = 0, confrelid = 0,
confupdtype = 32 ' ', confdeltype = 32 ' ', confmatchtype = 32 ' ',
conkey = {26}, confkey = {0}, conbin = {vl_len = 1, vl_dat = ""}, consrc = {
vl_len = 21, vl_dat = "\001"}}

And when I call pg_get_expr with:

consrc = DirectFunctionCall2(pg_get_expr, PointerGetDatum(&con->conbin), ObjectIdGetDatum(con->conrelid));

I get:

ERROR: invalid memory alloc request size 4294967294

--
greg

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2006-06-09 18:33:13 Re: That EXPLAIN ANALYZE patch still needs work
Previous Message dananrg 2006-06-09 16:54:56 Re: Fabian Pascal and RDBMS deficiencies in fully