Re: CREATE SCHEMA IF NOT EXISTS - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: CREATE SCHEMA IF NOT EXISTS
Date
Msg-id 1349204729-sup-3710@alvh.no-ip.org
Whole thread Raw
In response to Re: CREATE SCHEMA IF NOT EXISTS  ("Dickson S. Guedes" <listas@guedesoft.net>)
Responses Re: CREATE SCHEMA IF NOT EXISTS  ("David E. Wheeler" <david@justatheory.com>)
List pgsql-hackers
The fundamental issue with this patch hasn't been answered sufficiently,
I think.  Consider the following sequence of commands:

create schema if not exists foo create table first (a int);
create schema if not exists foo create table second (a int);


As far as I can see, with the patch as it currently stands, you would
end up with only table "first" in the schema, which seems very
surprising to me.

I think this needs more thought, and in any case it needs more
comprehensive regression test and documentation (i.e. at least the
examples ought to explain what would happen in such cases).

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: Raise a WARNING if a REVOKE affects nothing?
Next
From: Peter Geoghegan
Date:
Subject: Re: Hash id in pg_stat_statements