Skip site navigation (1) Skip section navigation (2)

Re: CREATE SCHEMA IF NOT EXISTS

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Dickson S(dot) Guedes <listas(at)guedesoft(dot)net>
Cc: fabriziomello <fabriziomello(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, david <david(at)justatheory(dot)com>
Subject: Re: CREATE SCHEMA IF NOT EXISTS
Date: 2012-10-02 19:08:16
Message-ID: 1349204729-sup-3710@alvh.no-ip.org (view raw or flat)
Thread:
Lists: 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


In response to

Responses

pgsql-hackers by date

Next:From: Peter GeogheganDate: 2012-10-02 19:09:35
Subject: Re: Hash id in pg_stat_statements
Previous:From: Noah MischDate: 2012-10-02 19:01:31
Subject: Re: Raise a WARNING if a REVOKE affects nothing?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group