Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d7Ndr-0004aF-Au for pgsql-committers@arkaria.postgresql.org; Sun, 07 May 2017 14:58:35 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d7Ndq-0006E8-TU for pgsql-committers@arkaria.postgresql.org; Sun, 07 May 2017 14:58:34 +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 1d7Ndq-0006Dg-9p for pgsql-committers@postgresql.org; Sun, 07 May 2017 14:58:34 +0000 Received: from mail-wr0-x22d.google.com ([2a00:1450:400c:c0c::22d]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1d7Ndn-0005mh-1f for pgsql-committers@postgresql.org; Sun, 07 May 2017 14:58:33 +0000 Received: by mail-wr0-x22d.google.com with SMTP id l50so26266291wrc.3 for ; Sun, 07 May 2017 07:58:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=bRP93pPSO4aMa4iuFC24FDm8RHaBJVBtjODQWTetwKo=; b=tI6p10hgtOelOP2IODLysMCSDo53pHbhcmYzU0mlXdINQuT12po9NbrMsdDmXmJ1f+ /lz1bNQdPOykgzn7mw1fvaLXs2Q0gtPz4fqdxcFDvuGs5MXudal/Lxed6XAFHHTaRWDb SS4ufmVNlg1JyMM+Ea7T/CobZMh37YHzbOkKDqsTIOG6J52BjxKW5cB6pPjY6hSd7D9w nNjeUVNIBQwYOacsJiIT0D1ueF1t88xQKNRYW3cRfT7KOqP//mmitrCgnRQRZl8oxjC4 a6ofZSdAj/95WmtnzjThOV0z3w+Ncg7AaIs3kyyWo1r0KW3AmrBwMxBxnHTULJs4+hMo XeeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=bRP93pPSO4aMa4iuFC24FDm8RHaBJVBtjODQWTetwKo=; b=PRiwNJLFfd6JcZAhZkS3n1J4Q/1Q1zVSGsvQ6Qk+i75M2mwXpxmAPW3UgQToncPFzY i3+yNMYQn8Iu2wZe8s1kRKqrYnTxR5A7JpCLYLg63wuBQ0BEVsi0FXaUO0vNPTjICCLa zVW5ZQUvwJmtSlawRkdomY9SQIje5EClAcxcntwUGh/3g02zauvIOfz+2Bi8WH01Ajfv BFy3ckVJpHswPFdn5gge4gQDQ5Aio2rh/krr/5aIVxaLn7z07wJnu6/egERUO9aw7WMD zapZQGV2VjnvEajF352dPgaPae6akQpS/8eJBXVlqMle9JldZejhk4DVt4/SAhJO/kHm c0hw== X-Gm-Message-State: AN3rC/6DDpP7yTeDAM1eGvcMK9n43pAMSwl4yTi0xTgnxFtRqmHzoKZl AZ0nRtZFpF4vmC2QKWzu/aCSGsaieA== X-Received: by 10.223.154.240 with SMTP id a103mr36762125wrc.5.1494169107798; Sun, 07 May 2017 07:58:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.206.4 with HTTP; Sun, 7 May 2017 07:58:27 -0700 (PDT) In-Reply-To: References: <22367.1494134345@sss.pgh.pa.us> From: Amit Kapila Date: Sun, 7 May 2017 20:28:27 +0530 Message-ID: Subject: Re: pgsql: Improve performance of timezone loading, especially pg_timezone_ To: David Rowley Cc: Tom Lane , pgsql-committers Content-Type: text/plain; charset=UTF-8 X-Pg-Spam-Score: -1.8 (-) 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 On Sun, May 7, 2017 at 2:33 PM, David Rowley wrote: > , On 7 May 2017 at 17:19, Tom Lane wrote: >> Amit Kapila writes: >>> On Wed, May 3, 2017 at 7:21 AM, Tom Lane 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