pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: pgsql-committers <pgsql-committers@postgresql.org>
Subject: Re: pgsql: Add function to import operating system collations
Date: Thu, 19 Jan 2017 11:54:07 -0500
Message-ID: <20170119165406.GT18360@tamriel.snowman.net> (raw)
In-Reply-To: <4700.1484844079@sss.pgh.pa.us>
References: <E1cTrLM-0008E8-6K@gemulon.postgresql.org>
	<CAA4eK1+z2ZwNvXMsfK-nTD5HeZqm6pLoXR7mXH_dVcbOoNYwDA@mail.gmail.com>
	<13753.1484830411@sss.pgh.pa.us>
	<dfd34b03-911b-adad-57f9-42833bb15610@2ndquadrant.com>
	<4700.1484844079@sss.pgh.pa.us>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
> > On 1/19/17 7:53 AM, Tom Lane wrote:
> >> Hm.  I see that the patch randomly changed the way that the collation
> >> owner is generated ... looks like it no longer works for mixed-case
> >> usernames.  Perhaps follow this model instead:
> 
> > We could just use the numeric value, like in the attached patch.
> 
> WFM.  Btw, I noticed that BOOTSTRAP_SUPERUSERID is hard-coded as "10"
> in this bit in setup_privileges():
> 
> 		" (SELECT E'=r/\"$POSTGRES_SUPERUSERNAME\"' as acl "
> 		"  UNION SELECT unnest(pg_catalog.acldefault("
> 		"    CASE WHEN relkind = 'S' THEN 's' ELSE 'r' END::\"char\",10::oid))"
> 		" ) as a) "
> 
> Is there a reasonable way to fix that?  Maybe do another replace_token
> call for it?

Hm.  I seem to recall trying to avoid having the hard-coded value there
but we don't have BOOTSTRAP_SUPERUSERID defined somewhere that initdb.c
could include it from, do we?  It's only in catalog/pg_authid.h.

We could re-define it in initdb.c, of course, and perhaps that'd be
better than having it hard-coded.  I'm not sure that we really want to
expose BOOTSTRAP_SUPERUSERID to regular client code, or create some
additional set of headers which are just for initdb and the backend..

Of course, I might be missing something here, but I'm pretty sure that
was my thinking when I wrote that code.

Thanks!

Stephen

Attachments:

  signature.asc (application/pgp-signature, 818B) download

view thread (24+ messages)  latest in thread

Message-ID: <20170119165406.GT18360@tamriel.snowman.net>
Permalink:  ../20170119165406.GT18360@tamriel.snowman.net/
Also on:    postgresql.org/message-id/20170119165406.GT18360@tamriel.snowman.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: sfrost@snowman.net, tgl@sss.pgh.pa.us, peter.eisentraut@2ndquadrant.com, amit.kapila16@gmail.com
  Subject: Re: pgsql: Add function to import operating system collations
  In-Reply-To: <20170119165406.GT18360@tamriel.snowman.net>
  References: <E1cTrLM-0008E8-6K@gemulon.postgresql.org> <CAA4eK1+z2ZwNvXMsfK-nTD5HeZqm6pLoXR7mXH_dVcbOoNYwDA@mail.gmail.com> <13753.1484830411@sss.pgh.pa.us> <dfd34b03-911b-adad-57f9-42833bb15610@2ndquadrant.com> <4700.1484844079@sss.pgh.pa.us> <20170119165406.GT18360@tamriel.snowman.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox