pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bret Hughes <bhughes@elevating.com>
Cc: Stephan Szabo <sszabo@megazone.bigpanda.com>
Cc: postgresql sql list <pgsql-sql@postgresql.org>
Subject: Re: trigger/for key help
Date: Sun, 11 Apr 2004 22:27:21 -0400
Message-ID: <28212.1081736841@sss.pgh.pa.us> (raw)
In-Reply-To: <1081724318.2628.20.camel@bretsony>
References: <1081662204.6609.72.camel@bretsony>
	<20040411080932.Q83278@megazone.bigpanda.com>
	<1081711155.6399.165.camel@bretsony>
	<17189.1081720813@sss.pgh.pa.us>
	<1081724318.2628.20.camel@bretsony>

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



view thread (11+ messages)  latest in thread

Message-ID: <28212.1081736841@sss.pgh.pa.us>
Permalink:  ../28212.1081736841@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/28212.1081736841@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, bhughes@elevating.com, sszabo@megazone.bigpanda.com
  Subject: Re: trigger/for key help
  In-Reply-To: <28212.1081736841@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox