Re: many copies of atooid() and oid_cmp()

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: many copies of atooid() and oid_cmp()
Date: 2017-01-12 13:39:29
Message-ID: 2918c84e-4c41-e498-cb3b-78a413dd8066@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 1/11/17 11:25 PM, Tom Lane wrote:
> Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com> writes:
>> There are approximately 11 copies of atooid() and 3 of oid_cmp() or
>> equivalent, and pending patches are proposing to add more. I propose
>> these two patches to collect them in central places.
>
> +1 for the concept, but I'm a bit worried about putting atooid() in
> postgres_ext.h. That's going to impose on the namespace of libpq-using
> applications, for instance. A more conservative answer would be to
> add it to c.h. OTOH, postgres_ext.h is where the Oid typedef lives,
> so I do see the consistency of adding this there. Hard choice.

How about two copies: one in postgres_fe.h and one in postgres.h?

> The oid_cmp() move looks fine if we only need it on the server side.
> But doesn't pg_dump have one too?

The pg_dump one isn't a qsort comparator, though.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2017-01-12 13:41:33 Re: many copies of atooid() and oid_cmp()
Previous Message Peter Eisentraut 2017-01-12 13:34:10 Re: Proposal for changes to recovery.conf API