Re: pgsql: Add function to import operating system collations

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-committers <pgsql-committers(at)postgresql(dot)org>
Subject: Re: pgsql: Add function to import operating system collations
Date: 2017-01-19 12:53:31
Message-ID: 13753.1484830411@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> writes:
> On Wed, Jan 18, 2017 at 8:06 PM, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
>> Add function to import operating system collations

> After this commit, initdb is failing with below error on one of my VM
> m/c (Linux amitkapila-centos-vm 2.6.32-358.11.1.el6.x86_64):

> performing post-bootstrap initialization ... 2017-01-19 15:19:14.409
> IST [3611] FATAL: role "amitkapila" does not exist at character 150
> 2017-01-19 15:19:14.409 IST [3611] STATEMENT: INSERT INTO
> pg_collation (collname, collnamespace, collowner, collencoding,
> collcollate, collctype) VALUES ('ucs_basic',
> 'pg_catalog'::regnamespace, 'Amitkapila'::regrole, 6, 'C', 'C');

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:

if (superuser_password)
PG_CMD_PRINTF2("ALTER USER \"%s\" WITH PASSWORD E'%s';\n\n",
username, escape_quotes(superuser_password));

although TBH that doesn't look too darn safe either. I wonder how
initdb has gotten along so far with no quote_ident() function.

regards, tom lane

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2017-01-19 14:33:58 Re: [COMMITTERS] pgsql: Generate fmgr prototypes automatically
Previous Message Alvaro Herrera 2017-01-19 12:47:24 pgsql: Allow negative years in make_date to represent BC years

Browse pgsql-hackers by date

  From Date Subject
Next Message Antonin Houska 2017-01-19 12:58:22 Re: PoC: Grouped base relation
Previous Message Andrew Borodin 2017-01-19 12:50:10 Re: Review: GIN non-intrusive vacuum of posting tree