Re: Patch to add support of "IF NOT EXISTS" to others "CREATE" statements

From: Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, "[pgdg] Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
Subject: Re: Patch to add support of "IF NOT EXISTS" to others "CREATE" statements
Date: 2014-03-31 22:28:46
Message-ID: CAFcNs+qjUBDHibXQS4wujXd3k4wrKnCr=Aq=ML6FbqG-7iKcGA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Mar 31, 2014 at 5:46 PM, Stephen Frost <sfrost(at)snowman(dot)net> wrote:
>
> * Fabrízio de Royes Mello (fabriziomello(at)gmail(dot)com) wrote:
> > Because they maintain user data?
>
> Eh? You mean like the sequence #? Yes, I'd expect 'CREATE OR REPLACE
> SEQUENCE' to want a minvalue or something on a 'replace' case to ensure
> that it doesn't roll backwards unless explicitly asked for. Perhaps
> the same for any non-default parameters as well, though I'd look at the
> other COR cases to see what they do.
>

You mean if we execute 'CREATE OR REPLACE' must we verify the default
values of this statement and compare with the existing ones?

> CREATE OR REPLACE ROLE is actually easier, no? All you'd be updating
> are the various role attributes, I'd think, since only those are
> available at CREATE time today. Any role memberships or ownership
> would be left alone.
>

Think about the statements below:

CREATE ROLE test NOLOGIN;
CREATE OR REPLACE ROLE test;

If we execute the statements above the result should be the role 'test' can
login. Correct?

Regards,

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
>> Timbira: http://www.timbira.com.br
>> Blog sobre TI: http://fabriziomello.blogspot.com
>> Perfil Linkedin: http://br.linkedin.com/in/fabriziomello
>> Twitter: http://twitter.com/fabriziomello

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2014-03-31 23:35:41 Re: B-Tree support function number 3 (strxfrm() optimization)
Previous Message Claudio Freire 2014-03-31 21:53:14 Re: posting tree compression (WAS: Proposal: fix range queries in btree_gin)