schemas and paths with the alter statement

From: Theodore Petrosky <tedpet5(at)yahoo(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: schemas and paths with the alter statement
Date: 2005-02-22 19:06:04
Message-ID: 20050222190604.90402.qmail@web41005.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I have to first admit that I am very green at this. I
thought that one could refer to a table in a fully
qualified path... public.testtable

I am fooling around with webobjects and EOModeler. at
one point it creates the sql to create my table
structure and it does something like:

ALTER TABLE public.test ADD CONSTRAINT public.test_PK
PRIMARY KEY (test);

I assumed that it would work. Did I miss something in
the docs that say you can not do this? Does "ALTER
TABLE" not work with 'public.' before the table name?

on 7.4.6

aswebtest=# ALTER TABLE public.test ADD CONSTRAINT
public.test_PK PRIMARY KEY (test);
ERROR: syntax error at or near "." at character 46

but it works if I remove the 'public.' from both
places

aswebtest=# ALTER TABLE test ADD CONSTRAINT test_PK
PRIMARY KEY (test);
NOTICE: ALTER TABLE / ADD PRIMARY KEY will create
implicit index "test_pk" for table "test"
ALTER TABLE

Ted


__________________________________
Do you Yahoo!?
Yahoo! Mail - Find what you need with new enhanced search.
http://info.mail.yahoo.com/mail_250

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2005-02-22 19:16:05 Re: schemas and paths with the alter statement
Previous Message Tom Lane 2005-02-22 18:04:08 Re: pg primary key bug?