> I am generating scripts from MSSQL Server and converting them to create
objects in PostgreSQL.  It is suprisingly easy.  However, I think I may have
hit a rock.
>
> It appears that PostgreSQL does not support listing constraints to be
added as in the following syntax:

I don't know why it won't accept that syntax, but I suspect that it might be
choking on the multiple additional constraints. Try adding each constraint
as a separate ALTER TABLE statement. This should work:

ALTER TABLE foo ADD FOREIGN KEY (fooid) REFERENCES bar (barid);
ALTER TABLE foo ADD FOREIGN KEY (footooid) REFERENCES baz (bazid);

> Is this true?  Is this something that is being considered for addition?

If you can add multiple constraints via a single ALTER TABLE according to
the SQL standard, I suspect that it will be added someday. But since you can
add them individually, I would suspect the priority would be VERY low on the
list.

> Also, I see that alter table add constraint does not work for defaults.
Is this something that is going to be added?

That I do hope will be added since the only way to replicate the
functionality is to drop, readd and repopulate a table.

Greg


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

Reply via email to