Re: pg_filenode_relation(0,0) elog - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pg_filenode_relation(0,0) elog
Date
Msg-id 2146777.1623469895@sss.pgh.pa.us
Whole thread Raw
In response to pg_filenode_relation(0,0) elog  (Justin Pryzby <pryzby@telsasoft.com>)
Responses Re: pg_filenode_relation(0,0) elog
List pgsql-hackers
Justin Pryzby <pryzby@telsasoft.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



pgsql-hackers by date:

Previous
From: Justin Pryzby
Date:
Subject: Re: PG 14 release notes, first draft
Next
From: Thomas Munro
Date:
Subject: Re: Add client connection check during the execution of the query