Re: trigger/for key help
| От | Tom Lane |
|---|---|
| Тема | Re: trigger/for key help |
| Дата | |
| Msg-id | 28212.1081736841@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: trigger/for key help (Bret Hughes <bhughes@elevating.com>) |
| Ответы |
Re: trigger/for key help
Re: trigger/for key help |
| Список | 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 по дате отправления: