pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Kapila <amit.kapila16@gmail.com>
To: David Rowley <david.rowley@2ndquadrant.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-committers <pgsql-committers@postgresql.org>
Subject: Re: pgsql: Improve performance of timezone loading, especially pg_timezone_
Date: Sun, 7 May 2017 20:28:27 +0530
Message-ID: <CAA4eK1LavHN_7HB7ztn3W5EgiqiB+GR_+2+LP3qb_+_Z7MbZ1A@mail.gmail.com> (raw)
In-Reply-To: <CAKJS1f8z_cuEcYED4J0OcN0Fg9JO46Umyq4hysYcmPgGumDSMg@mail.gmail.com>
References: <E1d5jRn-0004SY-Nx@gemulon.postgresql.org>
	<CAA4eK1LC7CaNhRAQ__C3ht1JVrPzaAXXhEJRnR5L6bfYHiLmWw@mail.gmail.com>
	<22367.1494134345@sss.pgh.pa.us>
	<CAKJS1f8z_cuEcYED4J0OcN0Fg9JO46Umyq4hysYcmPgGumDSMg@mail.gmail.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

On Sun, May 7, 2017 at 2:33 PM, David Rowley
<david.rowley@2ndquadrant.com> wrote:
> , On 7 May 2017 at 17:19, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Amit Kapila <amit.kapila16@gmail.com> writes:
>>> On Wed, May 3, 2017 at 7:21 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>>> Improve performance of timezone loading, especially pg_timezone_names view.
>>
>>> I am consistently getting below error after this commit in my Win7 machine:
>>> running bootstrap script ... 2017-05-07 05:09:13.383 GMT [7908] LOG:
>>> could not open directory "/installation/share/timezone/posixrules": No
>>> such file or directory
>>
>>> This occurs both during initdb and server start.
>>
>> You sure it wasn't there before, too?

Yes and that is confirmed by David as well.

>>  That commit did not add any
>> file reads that didn't happen before.
>
> It didn't exist before either, but I don't think the error is what you
> think. Please note the error message indicated it's looking for a
> "directory" named posixrules, not the file.
>
> The error seems to be due to this code:
>
> if (canonname == NULL)
> {
> int result;
>
> fullname[fullnamelen] = '/';
> /* test above ensured this will fit: */
> strcpy(fullname + fullnamelen + 1, name);
> result = open(fullname, O_RDONLY | PG_BINARY, 0);
> if (result >= 0)
> return result;
> /* If that didn't work, fall through to do it the hard way */
> }
>
> where we append the name, then try to open the file, but since the
> file does not exist result is < 0 and we fall through to the for(;;)
> loop and try to do scan_directory_ci() on the filename rather than the
> directory.
>
>
> /* If that didn't work, fall through to do it the hard way */
> fullname[fullnamelen] = '\0';
>

Yes, that is one way of doing it, otherwise, we could save the
original fullname (before appending 'name' to it) and then use the
same in for loop.

> but I've not yet looked into why the file is missing in the first place.

I think it is better to consider that as a separate patch as that is a
different problem that exists before this commit as well.

-- 
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers



view thread (17+ messages)  latest in thread

Message-ID: <CAA4eK1LavHN_7HB7ztn3W5EgiqiB+GR_+2+LP3qb_+_Z7MbZ1A@mail.gmail.com>
Permalink:  ../CAA4eK1LavHN_7HB7ztn3W5EgiqiB+GR_+2+LP3qb_+_Z7MbZ1A@mail.gmail.com/
Also on:    postgresql.org/message-id/CAA4eK1LavHN_7HB7ztn3W5EgiqiB+GR_+2+LP3qb_+_Z7MbZ1A@mail.gmail.com

 · 

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: amit.kapila16@gmail.com, david.rowley@2ndquadrant.com, tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Improve performance of timezone loading, especially pg_timezone_
  In-Reply-To: <CAA4eK1LavHN_7HB7ztn3W5EgiqiB+GR_+2+LP3qb_+_Z7MbZ1A@mail.gmail.com>
  References: <E1d5jRn-0004SY-Nx@gemulon.postgresql.org> <CAA4eK1LC7CaNhRAQ__C3ht1JVrPzaAXXhEJRnR5L6bfYHiLmWw@mail.gmail.com> <22367.1494134345@sss.pgh.pa.us> <CAKJS1f8z_cuEcYED4J0OcN0Fg9JO46Umyq4hysYcmPgGumDSMg@mail.gmail.com> <CAA4eK1LavHN_7HB7ztn3W5EgiqiB+GR_+2+LP3qb_+_Z7MbZ1A@mail.gmail.com>

* 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