Re: Add pg_basetype() function to obtain a DOMAIN base type

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: jian he <jian.universality@gmail.com>
Cc: Alexander Korotkov <aekorotkov@gmail.com>, Tomas Vondra <tomas.vondra@enterprisedb.com>, John Naylor <johncnaylorls@gmail.com>, Steve Chavez <steve@supabase.io>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2024-03-30T18:00:34Z
Lists: pgsql-hackers
I wrote:
> A fairly common solution to that is to return NULL for bad input,
> but in this case we could just have it return the OID unchanged.

After sleeping on it, I concluded that was a bad idea and we'd
be best off returning NULL for invalid type OIDs.  So this is
just about back to Steve's original proposal, except for being
a bit more bulletproof against races with DROP TYPE.
Pushed that way.

			regards, tom lane



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Add pg_basetype() function to extract a domain's base type.