Re: ambiguous sql states - Mailing list pgsql-hackers

From Tom Lane
Subject Re: ambiguous sql states
Date
Msg-id 1027.1061760448@sss.pgh.pa.us
Whole thread Raw
In response to Re: ambiguous sql states  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> I had a private chat with Dave about this.  It was my view that a missing
> file that is read by a backend COPY is indistinguishable from, say, a
> missing table or trigger, as far as recovery options by the client
> application are concerned.

Hm.  One problem in this area is that a file-not-found error could be a
user error (if the user-specified name in COPY or lo_import() or some
such is not found).  Or it could be a Postgres internal error (if a file
internal to the database can't be found).  I'm not sure it's real
practical to distinguish these cases in the code, unfortunately ---
unless people are excited enough about it to invent
errcode_for_user_file_access() as distinct from
errcode_for_file_access().  (Even if we wanted to do this, I'm unsure
how far up the changes might need to propagate.)

In either case, though, it is arguable that it's not appropriate to put
it under the "syntax error" SQLSTATE category.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Dave Cramer
Date:
Subject: Re: ambiguous sql states
Next
From: Tom Lane
Date:
Subject: Re: [SQL] "SELECT IN" Still Broken in 7.4b