On Nov 28, 2007 11:01 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > What is an actual enum type? And how should a user react if he got this
> > message? I would ask, "why not?".
> Yeah, I would too, but without a concrete example to look at it's hard
> to say if the situation could be improved.
Hmm. I've just tried, unsuccessfully, to trigger that branch both
calling those functions directly from psql and from plpython calling
plpy.prepare() and passing bogus type info in. It's harder than it
looks. I'm sure that there are code paths that will call those
functions without filling out that type info (e.g. from C user defined
function?), but they must surely fall outside of the expected use
cases. Hence the error code is probably correct. Unsure about the
message... we could make it extremely explicit e.g. "you're calling
this without filling in fcinfo" but we'd want to be really sure that
it's definitely only possible to trigger via user error before getting
that detailed. I'm not sure that we're completely confident of that,
so perhaps the vague-ish message is ok.
I wouldn't get too worried, though. These are defensive error messages
that are really just checking for sane input, and they seem difficult
to deliberately trip, let alone accidentally, so stressing about them
is probably unnecessary.
In response to
pgsql-hackers by date
|Next:||From: Tom Lane||Date: 2007-11-29 05:32:18|
|Subject: Re: unclear enum error messages |
|Previous:||From: Gregory Stark||Date: 2007-11-29 03:34:16|
|Subject: Re: How to write a c-function to return multiple bytea rows|