On Wed, 2 Jul 2003, Robert wrote:

> Tried ALTER TABLE (yes, this is 7.3) but \d says
>
> nbcz=# \d seasons
>                             Table "public.seasons"
>   Column  |  Type   |
> Modifiers
> ----------+---------+---------------------------------------------------------
>  id       | integer | not null default
> nextval('public.seasons_id_seq'::text)
>  hotel_id | integer |
>  name     | text    |
> Indexes: seasons_pkey primary key btree (id)
> Foreign Key constraints: $1 FOREIGN KEY (hotel_id) REFERENCES hotels(id)
> ON UPDATE NO ACTION ON DELETE NO ACTION
>
> and
>
> ALTER TABLE seasons DROP CONSTRAINT $1;
>
> didn't work. Apparently I'm more then a bit confused, but what's the
> name of the constraint here? I finally took a deep breath, dropped the
> database and edited dump directly. Now it seems to work, but I'd still
> like to now the correct way (ALTER TABLE but how?) Thanks for your help

I think (as previously replied) you'd want "$1". $1 is technically the
name, but I don't think $ is a valid identifier character in unquoted
names so you need to quote the name before you can use it, just as if
you'd named the constraint "FooBar", you couldn't use FooBar to refer to
it.  7.4's \d does quote the name which makes this more obvious.


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [EMAIL PROTECTED] so that your
      message can get through to the mailing list cleanly

Reply via email to