Re: trigger/for key help - Mailing list pgsql-sql

From Tom Lane
Subject Re: trigger/for key help
Date
Msg-id 28212.1081736841@sss.pgh.pa.us
Whole thread Raw
In response to Re: trigger/for key help  (Bret Hughes <bhughes@elevating.com>)
Responses Re: trigger/for key help
Re: trigger/for key help
List pgsql-sql
Bret Hughes <bhughes@elevating.com> writes:
> FWIW I tried to use alter table but could never get the parser to accept
> $1 as a constraint name.  I used single and double quotes as well as a
> lame attempt \$1.

Hm, "$1" works for me ...

regression=# create table foo (f1 int primary key);
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "foo_pkey" for table "foo"
CREATE TABLE
regression=# create table bar (f1 int references foo);
CREATE TABLE
regression=# \d bar     Table "public.bar"Column |  Type   | Modifiers
--------+---------+-----------f1     | integer |
Foreign-key constraints:   "$1" FOREIGN KEY (f1) REFERENCES foo(f1)
regression=# alter table bar drop constraint "$1";
ALTER TABLE
regression=#
        regards, tom lane


pgsql-sql by date:

Previous
From: Bret Hughes
Date:
Subject: Re: trigger/for key help
Next
From: Bret Hughes
Date:
Subject: Re: trigger/for key help