Re: Unrecognized exception condition "deprecated_feature"

From: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Andres Freund <andres(at)anarazel(dot)de>, Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Kouber Saparev <kouber(at)gmail(dot)com>, Postgres Bug <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Unrecognized exception condition "deprecated_feature"
Date: 2018-03-29 01:46:47
Message-ID: CAEepm=2z+gNBWWGyXdt=kJV0axSBHuG4Nr+725RUp_PNKuYTcg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Mar 29, 2018 at 2:22 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com> writes:
>>>> While we're on the topic, I know of at least one other author of a
>>>> non-core PL (besides myself) that has been frustrated by the fact that
>>>> errcodes.txt is not installed anywhere, making it impossible to
>>>> autogenerate a plerrcodes.h file in the extension build process.
>
>> Something like this? Or I guess src/backend/Makefile could do it directly.
>
> Patch seems reasonable as far as it goes, but what about the MSVC
> infrastructure?

Hmm. Here is an untested version that makes Install.pm treat it the
same way as it treats sql_features.txt. Does this look right?

> Also, do we need to discuss exactly where it's being installed to?
> Is the choice made here easy for an extension Makefile to locate?

${datadir} is:

--datadir=DIR read-only architecture-independent data [DATAROOTDIR]

The default comes from here:

--datarootdir=DIR read-only arch.-independent data root [PREFIX/share]

That is obtainable with pg_config --sharedir. It's a bit obscure that
--sharedir means ${datadir}, but in my tree I see:

src/port/Makefile: echo "#define PGSHAREDIR \"$(datadir)\"" >>$@

That makes its way into pg_config's clutches via this code:

src/port/path.c-get_share_path(const char *my_exec_path, char *ret_path)
src/port/path.c-{
src/port/path.c: make_relative_path(ret_path, PGSHAREDIR,
PGBINDIR, my_exec_path);
src/port/path.c-}

So after "make install" I can find the file like this:

$ ls -slap $(pg_config --sharedir)/errcodes.txt
64 -rw-r--r-- 1 munro staff 31450 29 Mar 14:40
/Users/munro/install/postgres/share/errcodes.txt

Would there be a better location?

--
Thomas Munro
http://www.enterprisedb.com

Attachment Content-Type Size
0001-Install-errcodes.txt-for-use-by-extensions-v2.patch application/octet-stream 2.8 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Stefan Krüger 2018-03-29 07:09:57 Re: BUG #15133: make check fails
Previous Message Tom Lane 2018-03-29 01:22:42 Re: Unrecognized exception condition "deprecated_feature"