diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2025-01-15 16:53:53 +0100 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2025-01-15 16:58:44 +0100 |
commit | de9037d0d085f25d3c220a45bfbb7abc5794a0c8 (patch) | |
tree | 3c5f8f1a85d205f3157fc26f9995282165111df9 /contrib/postgres_fdw/option.c | |
parent | 6fdd5d9563439285df200f7282f0ca68152ef72d (diff) | |
download | postgresql-de9037d0d085f25d3c220a45bfbb7abc5794a0c8.tar.gz postgresql-de9037d0d085f25d3c220a45bfbb7abc5794a0c8.zip |
Downgrade errors in object_ownercheck() to internal
The "does not exist" errors in object_ownership() were written as
ereport(), suggesting that they are user-facing. But no code path
except one can reach this function without first checking that the
object exists. If this were actually a user-facing error message,
then there would be some problems: get_object_class_descr() is meant
to be for internal errors only and does not support translation.
The one case that can reach this without first checking the object
existence is from be_lo_unlink(). (This makes some sense since large
objects are referred to by their OID directly.) In this one case, we
can add a line of code to check the object existence explicitly,
consistent with other LO code.
For the rest, downgrade the error messages to elog()s. The new
message wordings are the same as in DropObjectById().
Reviewed-by: Alvaro Herrera <alvherre@alvh.no-ip.org>
Discussion: https://www.postgresql.org/message-id/flat/da2f8942-be6d-48d0-ac1c-a053370a6b1f@eisentraut.org
Diffstat (limited to 'contrib/postgres_fdw/option.c')
0 files changed, 0 insertions, 0 deletions