On Sat, Sep 22, 2012 at 3:06 AM, David E. Wheeler <da...@justatheory.com>wrote:
> On Sep 21, 2012, at 10:59 AM, Tom Lane <t...@sss.pgh.pa.us> wrote: > > > I don't believe this has been thought through nearly carefully enough. > > If CREATE SCHEMA created a schema and nothing more, then the proposed > > implementation would probably be fine. But per spec, CREATE SCHEMA > > can specify not only creating the schema but a whole bunch of objects > > within the schema. As coded, if the schema exists then creation of > > the specified sub-objects is just skipped, regardless of whether they > > exist or not. I doubt that this is really sane behavior. Would the > > principle of least astonishment dictate that the IF NOT EXISTS option > > apply implicitly to each sub-object as well? (If so, we'd have to > > extend everything that can appear in OptSchemaEltList; most of those > > commands don't have IF NOT EXISTS options today.) > > I had no idea about that functionality. Seems very strange. > Isn't it this SQL? CREATE SCHEMA foo CREATE TABLE aa (a int) CREATE TABLE bb (b int); -- Michael Paquier http://michael.otacoo.com