Re: Patch to add support of "IF NOT EXISTS" to others "CREATE" statements - Mailing list pgsql-hackers

From Fabrízio de Royes Mello
Subject Re: Patch to add support of "IF NOT EXISTS" to others "CREATE" statements
Date
Msg-id CAFcNs+pW8V7aiC1fXykSWkNTFd70a8kqFxQLz6pp2DeECAvEog@mail.gmail.com
Whole thread Raw
In response to Re: Patch to add support of "IF NOT EXISTS" to others "CREATE" statements  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers

On Tue, Apr 1, 2014 at 1:14 AM, Michael Paquier <michael.paquier@gmail.com> wrote:
>
> On Tue, Apr 1, 2014 at 7:28 AM, Fabrízio de Royes Mello
> <fabriziomello@gmail.com> wrote:
> > 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?
> Except if I am missing something, the second query means that it is
> going to replace the existing user test with a new one, with the
> settings specified in the 2nd query, all being default values. As the
> default for login is NOLOGIN, the user test should not be able to log
> in the server.
>

Yeah... you are correct... I meant:

CREATE ROLE test LOGIN;
CREATE OR REPLACE ROLE test;

Then the COR will replace the user 'test' setting a new default value to NOLOGIN. Correct?

Regards,

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL

pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: Patch to add support of "IF NOT EXISTS" to others "CREATE" statements
Next
From: Michael Paquier
Date:
Subject: Re: PQputCopyData dont signal error