Re: Connection closed

From: Erik Ronström <kvarken(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Connection closed
Date: 2003-05-02 19:13:26
Message-ID: 20030502191326.61173.qmail@web13808.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I just discovered an interesting thing: the problem comes from this
code:

EXECUTE ''ALTER TABLE '' || dv || '' ADD CONSTRAINT idfk FOREIGN KEY
(_id) REFERENCES dt_'' || a_table;

If I put it into a temp variable, it doesn't help:

temp := ''ALTER TABLE '' || dv || '' ADD CONSTRAINT idfk FOREIGN KEY
(_id) REFERENCES dt_'' || a_table;
EXECUTE temp;

However, if I raise a notice just before the EXECUTE statement, it
suddenly works!

temp := ''ALTER TABLE '' || dv || '' ADD CONSTRAINT idfk FOREIGN KEY
(_id) REFERENCES dt_'' || a_table;
RAISE NOTICE ''%'', temp;
EXECUTE temp;

Strange, IMO.

Erik

__________________________________________________
Yahoo! Plus
For a better Internet experience
http://www.yahoo.co.uk/btoffer

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Benjamin Scherrey 2003-05-02 20:26:27 Status of OIDs was: Re: select first occurrence of a table
Previous Message Erik Ronström 2003-05-02 19:08:42 Connection closed