Re: duplicate function oid symbols

2020-10-29 Thread Tom Lane
John Naylor writes: > Here is a quick patch implementing this much. Pushed with a couple cosmetic tweaks. regards, tom lane

Re: duplicate function oid symbols

2020-10-28 Thread John Naylor
On Wed, Oct 28, 2020 at 3:24 PM Tom Lane wrote: > > Nah. What I'm imagining is just that pg_type.h contains > > #ifdef EXPOSE_TO_CLIENT_CODE > > /* > * Backwards compatibility for ancient random spellings of OID macros. > * Don't use these macros in new code. > */ > #define CASHOID MONEYOID

Re: duplicate function oid symbols

2020-10-28 Thread Tom Lane
Andres Freund writes: > I assume you plan to error out if oid_symbol is defined for pg_type > going forward? Right, just like we just did for pg_proc. regards, tom lane

Re: duplicate function oid symbols

2020-10-28 Thread John Naylor
On Wed, Oct 28, 2020 at 3:24 PM Tom Lane wrote: > and then the negotiation here is only about whether to make this list > longer. We don't need to complicate genbki.pl with a new facility. > Agreed, and reformat_dat_files.pl must also know about these special attributes. -- John Naylor Enterp

Re: duplicate function oid symbols

2020-10-28 Thread Andres Freund
On 2020-10-28 15:24:20 -0400, Tom Lane wrote: > Nah. What I'm imagining is just that pg_type.h contains > > #ifdef EXPOSE_TO_CLIENT_CODE > > /* > * Backwards compatibility for ancient random spellings of OID macros. > * Don't use these macros in new code. > */ > #define CASHOID MONEYOID > #d

Re: duplicate function oid symbols

2020-10-28 Thread Tom Lane
Andres Freund writes: > On 2020-10-28 14:49:06 -0400, Tom Lane wrote: >> Moreover, this clearly shows the >> effect John mentioned that people have been copying the style of adjacent >> entries rather than making use of the standard oid_symbol convention like >> they should --- some of these don't

Re: duplicate function oid symbols

2020-10-28 Thread Andres Freund
Hi, On 2020-10-28 14:49:06 -0400, Tom Lane wrote: > The other extant oid_symbol entries are > > PGNODETREEOID > PGNDISTINCTOID > PGDEPENDENCIESOID > PGMCVLISTOID > PGDDLCOMMANDOID > EVTTRIGGEROID > The only one of these that client code would plausibly be using is LSNOID, > and even that is a bi

Re: duplicate function oid symbols

2020-10-28 Thread Tom Lane
Andres Freund writes: > I think changing type oid macro names is somewhat problematic - in > contrast to function oid macros the type macros are much more likely to > be used by client applications, e.g. for deciding whether to use binary > or text format for a type. > A quick code search shows a

Re: duplicate function oid symbols

2020-10-28 Thread Andres Freund
Hi, Thanks for fixing the HEAP_TABLE_AM_HANDLER_OID one. On 2020-10-28 14:08:28 -0400, John Naylor wrote: > > The only existing oid_symbol in pg_type that I think has enough > > grandfather status to be tough to change is CASHOID for "money". > > But we could imagine special-casing that with a ha

Re: duplicate function oid symbols

2020-10-28 Thread John Naylor
On Wed, Oct 28, 2020 at 12:25 PM Tom Lane wrote: > I wondered about introducing a similar prohibition for pg_type. > That might be worth doing, since some of the grandfathered macros are clustered together, which could lead to more cases creeping in as people match new types to examples nearby.

Re: duplicate function oid symbols

2020-10-28 Thread Tom Lane
John Naylor writes: >> Ok, here is a patch to fix that, and also throw an error if pg_proc.dat >> has an explicitly defined symbol. > It occurred to me I neglected to explain the error with a comment, which > I've added in v2. Pushed with a bit of tweaking of the error message. I wondered about

Re: duplicate function oid symbols

2020-10-28 Thread John Naylor
I wrote: > Ok, here is a patch to fix that, and also throw an error if pg_proc.dat > has an explicitly defined symbol. > It occurred to me I neglected to explain the error with a comment, which I've added in v2. -- John Naylor EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL

Re: duplicate function oid symbols

2020-10-27 Thread Michael Paquier
On Tue, Oct 27, 2020 at 05:40:09PM -0400, John Naylor wrote: > Ok, here is a patch to fix that, and also throw an error if pg_proc.dat has > an explicitly defined symbol. I am not seeing any uses of HEAP_TABLE_AM_HANDLER_OID in the wild, so +1 for just removing it, and not back-patch. -- Michael

Re: duplicate function oid symbols

2020-10-27 Thread John Naylor
On Tue, Oct 27, 2020 at 9:51 AM Tom Lane wrote: > John Naylor writes: > > I noticed that the table AM abstraction introduced the symbol > > HEAP_TABLE_AM_HANDLER_OID, although we already have a convention for > > defining symbols automatically for builtin functions, which in this case > is > > (

Re: duplicate function oid symbols

2020-10-27 Thread Tom Lane
John Naylor writes: > I noticed that the table AM abstraction introduced the symbol > HEAP_TABLE_AM_HANDLER_OID, although we already have a convention for > defining symbols automatically for builtin functions, which in this case is > (currently unused) F_HEAP_TABLEAM_HANDLER. Yeah, that seems wr