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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-10-02 19:48:33 Re: CREATE SCHEMA IF NOT EXISTS
Previous Message Alvaro Herrera 2012-10-02 19:30:05 Re: CREATE SCHEMA IF NOT EXISTS