Re: Why is pg_lsn marking itself a preferred type?

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Why is pg_lsn marking itself a preferred type?
Date: 2014-05-27 23:27:18
Message-ID: CAB7nPqQj6UUgV3s3nGELjH2dYgp+WUfxhCf3CH10LZTtTSEg8g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, May 28, 2014 at 4:27 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> One of these doesn't belong:
>
> postgres=# select typname, typcategory from pg_type where typispreferred;
> typname | typcategory
> -------------+-------------
> bool | B
> text | S
> oid | N
> float8 | N
> inet | I
> timestamptz | D
> interval | T
> varbit | V
> pg_lsn | U
> (9 rows)
>
> Was there any actual rationale to this, or was it just somebody who did
> not understand what that bit is for?
Looks like an oversight of the pg_lsn patch. You could blame me for
that I suppose...

> I think it's probably mostly harmless given the lack of casts to or from
> pg_lsn, but it's still a darn bad idea to have any preferred types in the
> 'U' category. If we leave it like this it will bite us in the rear
> eventually.
> The most expedient response at this late date seems to be to change the
> entry in pg_type.h without bumping catversion. That way at least it
> will be right in databases initdb'd after beta2.
Agreed. Attached patch fixes that, but I am sure that you already
figured it out.
--
Michael

Attachment Content-Type Size
20140528_pg_lsn_unpreferred.patch text/x-patch 1003 bytes

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-05-27 23:46:41 Re: [PATCH] Replacement for OSSP-UUID for Linux and BSD
Previous Message Andrew Dunstan 2014-05-27 23:25:46 Re: json casts