Re: pg_filenode_relation(0,0) elog

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: pg_filenode_relation(0,0) elog
Date: 2021-06-12 03:51:35
Message-ID: 2146777.1623469895@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Justin Pryzby <pryzby(at)telsasoft(dot)com> writes:
> Per sqlsmith.
> postgres=# SELECT pg_filenode_relation(0,0);
> ERROR: unexpected duplicate for tablespace 0, relfilenode 0

Ugh.

> The usual expectation is that sql callable functions should return null rather
> than hitting elog().

Agreed, but you should put the short-circuit into the SQL-callable
function, ie pg_filenode_relation. Lower-level callers ought not be
passing junk data.

Likely it should check the reltablespace, too.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2021-06-12 04:24:01 Re: Add client connection check during the execution of the query
Previous Message Justin Pryzby 2021-06-12 03:45:51 Re: PG 14 release notes, first draft