Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cUCDm-0000ar-QE for pgsql-committers@arkaria.postgresql.org; Thu, 19 Jan 2017 12:53:42 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cUCDl-0008KD-Qv for pgsql-committers@arkaria.postgresql.org; Thu, 19 Jan 2017 12:53:41 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cUCDl-0008Jl-71 for pgsql-committers@postgresql.org; Thu, 19 Jan 2017 12:53:41 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cUCDi-0002O0-Ez for pgsql-committers@postgresql.org; Thu, 19 Jan 2017 12:53:39 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v0JCrVcD013754; Thu, 19 Jan 2017 07:53:31 -0500 From: Tom Lane To: Amit Kapila cc: Peter Eisentraut , pgsql-committers Subject: Re: pgsql: Add function to import operating system collations In-reply-to: References: Comments: In-reply-to Amit Kapila message dated "Thu, 19 Jan 2017 16:13:44 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <13752.1484830411.1@sss.pgh.pa.us> Date: Thu, 19 Jan 2017 07:53:31 -0500 Message-ID: <13753.1484830411@sss.pgh.pa.us> 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 Amit Kapila writes: > On Wed, Jan 18, 2017 at 8:06 PM, Peter Eisentraut 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 -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers