Re: How to get schema name which violates fk constraint

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>, Andrus <kobruleht2(at)hot(dot)ee>, pgsql-general(at)postgresql(dot)org
Subject: Re: How to get schema name which violates fk constraint
Date: 2008-10-22 17:14:43
Message-ID: 20081022171443.GC4022@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane escribió:

> A comprehensive response to this type of gripe wouldn't be all that
> "easy". In the first place, there'd be a lot of code to touch.

Well, that makes it tedious, which is not the same as hard.

> In the second place, the reason most of our messages don't already
> contain schema names is that in the past we've judged it would be
> mostly clutter; and given the infrequency of complaints I see no
> reason to change that opinion.

I tend to disagree. We can run a poll in a wider audience.

> The type of fix I'd like to see would be to not change message texts at
> all, but to add separate error-message fields for the name and schema
> name of object(s) involved in an error; which would be details that
> psql, for example, would show only in VERBOSE mode. Note that error
> report fields along this line are actually required by the SQL spec
> (cf GET DIAGNOSTICS) but we've never got round to implementing 'em.

Now that's a bit more complex than the trivial solution of adding an
extra %s to the error message, but it's still not all that difficult, I
think.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-10-22 17:27:58 Re: How to get schema name which violates fk constraint
Previous Message Andrus 2008-10-22 17:13:04 Re: How to get schema name which violates fk constraint