Re: Connection closed

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: gitarrerik(at)musiker(dot)nu
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Connection closed
Date: 2003-05-02 21:28:37
Message-ID: 2720.1051910917@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

=?iso-8859-1?q?Erik=20Ronstr=F6m?= <kvarken(at)yahoo(dot)com> writes:
> 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;

You're going to need to provide a self-contained example, or else a
stack trace. This simple experiment didn't reproduce it:

regression=# create function doit(text) returns int as '
regression'# begin
regression'# execute $1;
regression'# return 1;
regression'# end' language plpgsql;
CREATE FUNCTION
regression=# create table ff1 (f1 int primary key);
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'ff1_pkey' for table 'ff1'
CREATE TABLE
regression=# create table ff2 (f1 int);
CREATE TABLE
regression=# select doit('alter table ff2 add constraint idfk foreign key(f1)
regression'# references ff1');
NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
doit
------
1
(1 row)

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Erik Ronström 2003-05-02 21:37:47 Re: Connection closed
Previous Message scott.marlowe 2003-05-02 21:21:41 Re: PostgreSQL Inquiry