Re: [COMMITTERS] pgsql: Add function to import operating system collations - Mailing list pgsql-committers

From Tom Lane
Subject Re: [COMMITTERS] pgsql: Add function to import operating system collations
Date
Msg-id 13753.1484830411@sss.pgh.pa.us
Whole thread Raw
In response to Re: [COMMITTERS] pgsql: Add function to import operating system collations  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: [COMMITTERS] pgsql: Add function to import operating systemcollations
List pgsql-committers
Amit Kapila <amit.kapila16@gmail.com> writes:
> On Wed, Jan 18, 2017 at 8:06 PM, Peter Eisentraut <peter_e@gmx.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


pgsql-committers by date:

Previous
From: Alvaro Herrera
Date:
Subject: [COMMITTERS] pgsql: Allow negative years in make_date to represent BC years
Next
From: Peter Eisentraut
Date:
Subject: Re: [COMMITTERS] pgsql: Add function to import operating systemcollations