Re: Unrecognized exception condition "deprecated_feature"
Thomas Munro <thomas.munro@enterprisedb.com>
From: Thomas Munro <thomas.munro@enterprisedb.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>,
Andres Freund <andres@anarazel.de>, Andrew Gierth <andrew@tao11.riddles.org.uk>, "David G. Johnston" <david.g.johnston@gmail.com>,
Kouber Saparev <kouber@gmail.com>, Postgres Bug <pgsql-bugs@postgresql.org>
Date: 2018-03-29T01:46:47Z
Lists: pgsql-bugs
Attachments
- 0001-Install-errcodes.txt-for-use-by-extensions-v2.patch (application/octet-stream) patch v2-0001
On Thu, Mar 29, 2018 at 2:22 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Thomas Munro <thomas.munro@enterprisedb.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
Commits
-
Install errcodes.txt for use by extensions.
- 1fd869066863 11.0 landed
-
Adjust input routines for float4, float8 and oid to reject the empty string
- 975e27377aad 8.1.0 cited
-
Emit a warning when an empty string is input to the oid, float4, and
- 2146bfc869bf 8.0.0 cited