Re: CREATE USER

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp>
Cc: "Thomas Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu>, "Lista PGSQL" <pgsql-general(at)postgresql(dot)org>, "Diego Schvartzman" <dschvar(at)yahoo(dot)com>
Subject: Re: CREATE USER
Date: 2000-06-01 06:45:58
Message-ID: 22642.959841958@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)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?

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, how about downgrading the "create
user not allowed in transaction" error to a "please don't abort now"
notice? It's pretty silly that CREATE USER is stiffnecked about this
when DROP TABLE is not --- the bad consequences of rolling back DROP
TABLE are a lot worse.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jurgen Defurne 2000-06-01 06:49:04 Re: Re: Speed of locating tables
Previous Message Louis-David Mitterrand 2000-06-01 06:17:12 Re: [HACKERS] Oft Ask: How to contribute to PostgreSQL?