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

Re: CREATE SCHEMA IF NOT EXISTS

From: "David E(dot) Wheeler" <david(at)justatheory(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Dickson S(dot) Guedes <listas(at)guedesoft(dot)net>, fabriziomello <fabriziomello(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: CREATE SCHEMA IF NOT EXISTS
Date: 2012-10-02 19:37:30
Message-ID: 59BF1E0D-ECB6-45DA-8020-EBB9CF605BF3@justatheory.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Oct 2, 2012, at 12:30 PM, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> wrote:

> How about call this for precedent:
> 
> mkdir -p /tmp/foo/bar
> mkdir -p /tmp/foo/baz
> 
> In this case you end up with directory "foo" and at least two subdirs in
> it, bar and baz.  This works even if /tmp/foo existed previously and
> even if there was some other stuff in it.

Well, what about this, then?

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

David



In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2012-10-02 19:48:33
Subject: Re: CREATE SCHEMA IF NOT EXISTS
Previous:From: Alvaro HerreraDate: 2012-10-02 19:30:05
Subject: Re: CREATE SCHEMA IF NOT EXISTS

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