RE: CREATE USER - Mailing list pgsql-general

From Hiroshi Inoue
Subject RE: CREATE USER
Date
Msg-id 000a01bfcb9b$504f31c0$2801007e@tpf.co.jp
Whole thread Raw
In response to Re: CREATE USER  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
> -----Original Message-----
> From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
>
> "Hiroshi Inoue" <Inoue@tpf.co.jp> writes:
> > How about starting new transaction automatically after committing
> > "create user ..." at backend side if "create user" is the first command
> > of the transaction ?
>
> So then
>     begin;
>     create user ...;
>     rollback;
>
> would do the wrong thing --- silently?
>

It seems not wrong that un-rollbackable command is never rolled back.
At least it doesn't cause inconsistency.

> I don't think that's an improvement :-(
>
> The only reason CREATE USER isn't rollbackable is that the flat password
> file is updated immediately by a trigger, rather than at transaction
> commit.  The right fix would be to defer the update until commit (which
> is certainly doable, though it might mean hardwired support for the
> update instead of doing it in a generic trigger function).
>
> If that seems like too much work,

I don't prefer flat file solution as I mentioned before.

> how about downgrading the "create
> user not allowed in transaction" error to a "please don't abort now"
> notice?

Sounds preferable.

Regards.

Hiroshi Inoue
Inoue@tpf.co.jp

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: CREATE USER
Next
From: Richard Harvey Chapman
Date:
Subject: Re: Re: Speed of locating tables