Skip site navigation (1) Skip section navigation (2)

Re: Raw constraint & pg_relcheck.rcsrc

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp>
Cc: "pgsql-hackers" <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: Raw constraint & pg_relcheck.rcsrc
Date: 2000-08-04 01:24:23
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
"Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp> writes:
> Is there any way to convert rcbin(cooked text format) to the
> raw(pre-cooked) Node expression?


> Or is there a way to
> convert rcsrc to the pre-cooked Node expression ?
> Or is there a way to convert rcsrc to the cooked expression ?

I think what you'd have to do is take the parent's rcsrc and run it
through the parse and transform phases again, using the new child
table as the reference for attribute name resolution.  Thomas might
have a clearer idea than I do about the cleanest way to interface
to the parser for that.

Another possibility is to determine the mapping from parent columns
to child columns, and then walk through the (cooked) expression tree
and substitute varattno field values in Var nodes accordingly.  I'm
not certain that's sufficient, but if it is it'd be a fairly small
amount of code (in fact you might be able to just call the routines in
the rewriter that do similar things).

			regards, tom lane

In response to


pgsql-hackers by date

Next:From: Tom LaneDate: 2000-08-04 01:25:27
Subject: Re: MAC.C (still?)
Previous:From: Tom LaneDate: 2000-08-04 01:10:53
Subject: Re: [HACKERS] pg_dump/restore to convert BLOBs to LZTEXT (optional!)

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group