On 2023-Aug-29, Peter Eisentraut wrote: > From 471fda80c41fae835ecbe63ae8505526a37487a9 Mon Sep 17 00:00:00 2001 > From: Peter Eisentraut <pe...@eisentraut.org> > Date: Wed, 12 Jul 2023 16:12:35 +0200 > Subject: [PATCH v2 04/10] Add TupleDescGetDefault() > > This unifies some repetitive code. > > Note: I didn't push the "not found" error message into the new > function, even though all existing callers would be able to make use > of it. Using the existing error handling as-is would probably require > exposing the Relation type via tupdesc.h, which doesn't seem > desirable.
Note that all errors here are elog(ERROR), not user-facing, so ISTM it would be OK to change them to report the relation OID rather than the name. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "In fact, the basic problem with Perl 5's subroutines is that they're not crufty enough, so the cruft leaks out into user-defined code instead, by the Conservation of Cruft Principle." (Larry Wall, Apocalypse 6)