Re: Question about an inconsistency - 1

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "petrum(at)gmail(dot)com" <petrum(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Question about an inconsistency - 1
Date: 2016-07-06 20:22:07
Message-ID: 3260.1467836527@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"petrum(at)gmail(dot)com" <petrum(at)gmail(dot)com> writes:
> I have a question regarding the source code in file pg_proc.h (postgresql-9.4.4).

> At line 1224 (copied below) why the 28th identifier is timestamp_eq?

> DATA(insert OID = 1152 ( timestamptz_eq PGNSP PGUID 12 1 0 0 0 f f f t t f i 2 0 16 "1184 1184" _null_ _null_ _null_ _null_ timestamp_eq _null_ _null_ _null_ ));

> I would expect it to be timestamptz_eq (the same as the 5th identifier
> from the same line).

If timestamptz_eq actually existed as a separate C function, then yes that
would be correct. But see this bit in timestamp.h:

extern int timestamp_cmp_internal(Timestamp dt1, Timestamp dt2);

/* timestamp comparison works for timestamptz also */
#define timestamptz_cmp_internal(dt1,dt2) timestamp_cmp_internal(dt1, dt2)

AFAICS there are not similar #defines equating timestamptz_eq to
timestamp_eq and so on, probably because we don't have much need
to refer to those functions in the C code. But even if we had
such #defines, I think that pg_proc.h could not rely on them.
It has to reference actual C functions.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2016-07-06 21:55:56 Re: Re: [COMMITTERS] pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold <
Previous Message Stephen Frost 2016-07-06 19:43:11 Re: primary_conninfo missing from pg_stat_wal_receiver