Re: Add schema-qualified relnames in constraint error messages. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Add schema-qualified relnames in constraint error messages.
Date
Msg-id 1384.1452043312@sss.pgh.pa.us
Whole thread Raw
In response to Add schema-qualified relnames in constraint error messages.  (Petr Korobeinikov <pkorobeinikov@gmail.com>)
Responses Re: Add schema-qualified relnames in constraint error messages.
List pgsql-hackers
Petr Korobeinikov <pkorobeinikov@gmail.com> writes:
> At the moment schemas used as single-level namespaces.
> It's quite convenient in large databases.

> But error messages doesn’t contain schema names.

> I have done a little patch with schema-qualified relation names in error
> messages that produced by foreign key constraints and triggers.

We have gone around on this before and pretty much concluded we didn't
want to do it; the demand is too small and the risk of breaking things
too large.  In particular, your patch as presented *would* break every
application that is still parsing primary error messages to extract
object names from them.

What seems more likely to be useful and to not break anything is to push
forward on adding PG_DIAG_SCHEMA_NAME and similar auxiliary fields to more
error messages (see errtable() and siblings).  That would allow
applications to extract this information automatically and reliably.
Only after that work is complete and there's been a reasonable amount of
time for clients to start relying on it can we really start thinking about
whacking the message texts around.

Aside from those points, it's quite unacceptable to format qualified names
as you propose here; they would really have to look more like "foo"."bar"
to prevent confusion.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Haribabu Kommi
Date:
Subject: Re: Multi-tenancy with RLS
Next
From: Jim Nasby
Date:
Subject: Re: No Issue Tracker - Say it Ain't So!