Re: Add schema-qualified relnames in constraint error messages.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Petr Korobeinikov <pkorobeinikov(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add schema-qualified relnames in constraint error messages.
Date: 2016-01-06 01:21:52
Message-ID: 1384.1452043312@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Petr Korobeinikov <pkorobeinikov(at)gmail(dot)com> writes:
> At the moment schemas used as single-level namespaces.
> It's quite convenient in large databases.

> But error messages doesnt 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2016-01-06 02:11:32 Re: No Issue Tracker - Say it Ain't So!
Previous Message Haribabu Kommi 2016-01-06 01:17:46 Re: Multi-tenancy with RLS