Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cUFzU-0006SZ-FG for pgsql-committers@arkaria.postgresql.org; Thu, 19 Jan 2017 16:55:12 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cUFzU-0000Vk-2J for pgsql-committers@arkaria.postgresql.org; Thu, 19 Jan 2017 16:55:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cUFzT-0000U5-AW for pgsql-committers@postgresql.org; Thu, 19 Jan 2017 16:55:11 +0000 Received: from tamriel.snowman.net ([72.66.115.51]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cUFzP-00008Y-P9 for pgsql-committers@postgresql.org; Thu, 19 Jan 2017 16:55:10 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 12E145F794; Thu, 19 Jan 2017 11:54:07 -0500 (EST) Date: Thu, 19 Jan 2017 11:54:07 -0500 From: Stephen Frost To: Tom Lane Cc: Peter Eisentraut , Amit Kapila , pgsql-committers Subject: Re: pgsql: Add function to import operating system collations Message-ID: <20170119165406.GT18360@tamriel.snowman.net> References: <13753.1484830411@sss.pgh.pa.us> <4700.1484844079@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="FxVbOi/ze/qufdlG" Content-Disposition: inline In-Reply-To: <4700.1484844079@sss.pgh.pa.us> X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/3.13.0-91-generic (x86_64) X-Uptime: 11:49:13 up 194 days, 18:13, 3 users, load average: 0.03, 0.07, 0.10 User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -5.1 (-----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org --FxVbOi/ze/qufdlG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Tom Lane (tgl@sss.pgh.pa.us) wrote: > Peter Eisentraut 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: >=20 > > We could just use the numeric value, like in the attached patch. >=20 > WFM. Btw, I noticed that BOOTSTRAP_SUPERUSERID is hard-coded as "10" > in this bit in setup_privileges(): >=20 > " (SELECT E'=3Dr/\"$POSTGRES_SUPERUSERNAME\"' as acl " > " UNION SELECT unnest(pg_catalog.acldefault(" > " CASE WHEN relkind =3D 'S' THEN 's' ELSE 'r' END::\"char\",10::oid)= )" > " ) as a) " >=20 > 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 --FxVbOi/ze/qufdlG Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJYgO8uAAoJEO1sijiDR2RVUdcP/24QspO3dURwHqn7v/rF0t6d EXHZjJJv6Lcokl+dZugT32q3/brTCLturyJjDb8E1os+49v3sr2Fs48iDbYu9rQH /kOFYJkhjXyZapvhx11IK4qSk7srzKi6YQnIIljJikMOpjwJyVMAXiVnioJ4BSgv 4/IRPWleitLamdFoZ7oHF02JcGdDv7t9ZhnKRvG7NtbpWM88gI1hnj64qZs+81T9 IDWU4K6qb43DCvTW9cCabpvYLUTBrvJYKKzg57SO22k+wa+Fw81gGQG8J+yE9WLS lWLjbEfsGL1nA9dEsc2/YJ1Z1vVMr3hGaiwor+3RKyrE/nFYDyAdApqfDT6TJq52 z6rPYPn4SD4YxHJ5n8k21ab8shL1Or8x7DLScYYswULbBdlozhVpxGUSqxXtGl6e StlXJASTobHHvh7TvV4nM260FjUrkUFcuFSQp9tu2jgCzVLf2ICemmxPBrCx+BKt Rr+MIaZ83LR5HyUxXsPTMJIlfsl/PhOhKa174b2UFyd25+MC2PpzyYWYSl2GiiA9 I2B33AYfGjFxaWg91LUpCr8b2ojTQsgQ3y5coiboP3GcmBpZXqUW+g1jCakgC4mp EZsJvsMQ6AZ+jdrnLewxoe4/e8Ze1ovE5vX5OqWtFh85PBs6/KbQJS4jKBlhV+WF plElYINSjeHQraIc0Mse =leFb -----END PGP SIGNATURE----- --FxVbOi/ze/qufdlG--