Re: fix schema ownership for database owner on first connection

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: fix schema ownership for database owner on first connection
Date: 2004-06-10 03:50:24
Message-ID: 200406100350.i5A3oOM10977@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches


Would you adjust based on Tom's comments and resubmit? Thanks.

---------------------------------------------------------------------------

Fabien COELHO wrote:
>
> Dear patchers,
>
> Please find attached a patch to fix schema ownership on first connection,
> so that non system schemas reflect the database owner.
>
> (1) It adds a new "datisinit" attribute to pg_database, which tells
> whether the database initialization was performed or not.
> The documentation is updated accordingly.
>
> (2) This boolean is tested in postinit.c:ReverifyMyDatabase,
> and InitializeDatabase is called if necessary.
>
> (3) The routine updates pg_database datisinit, as well as pg_namespace
> ownership and acl stuff.
>
> (4) Some validation is added. This part validates for me
> (although rules and errors regression tests are broken in current
> cvs head, independtly of this patch).
>
> Some questions/comments :
>
> - is the place for the first connection housekeeping updates appropriate?
> it seems so from ReverifyMyDatabase comments, but these are only comments.
>
> - it is quite convenient to use SPI_* stuff for this very rare updates,
> but I'm not that confident about the issue... On the other hand, the
> all-C solution would result in a much longer and less obvious code:-(
>
> - it is unclear to me whether it should be allowed to skip this under
> some condition, when the database is accessed in "debug" mode from
> a standalone postgres for instance?
>
> - also I'm wondering how to react (what to do and how to do it) on
> errors within or under these initialization. For instance, how to
> be sure that the CurrentUser is reset as expected?
>
> Thanks in advance for any comments.
>
> Have a nice day.
>
> --
> Fabien.

Content-Description:

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2004-06-10 04:01:25 Re: [HACKERS] select like...not using index
Previous Message Bruce Momjian 2004-06-10 03:46:05 Re: FAQ translation to pt_BR