pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Sabino Mullane <greg@turnstep.com>
To: pgsql-sql@postgresql.org
Cc: twanger@bluetwanger.de
Subject: Re: getting details about integrity constraint violation
Date: Wed, 15 Jun 2005 02:06:20 -0000
Message-ID: <93b83a5f4f948719c40b2ecac346c692@biglumber.com> (raw)
In-Reply-To: <1118728010.7429.0.camel@localhost.localdomain>


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


>> Simply name the table constraints yourself with a descriptive name, so you
>> always know exactly what is going on:

> And then I keep a list of all the constraint names and scan the error
> message for it?

Don't keep a list: just come up with a standard naming scheme, such as:

"tablename|colname|is_not_unique"

which should be human and machine parseable (perl example):

if ($error =~ m#^(.+)\|(.+)\|is_not_unique$#o) {
        die qq{Whoops : looks like column "$2" of table "$1" needs to be unique\n};
}

- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200506142204
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iD8DBQFCr4zivJuQZxSWSsgRAgGPAJ0awkoBmus6z1cLBRpsR5xmQPTfiACgpJxG
Ld90hEGDPrebBE3JGGL11L4=
=smQJ
-----END PGP SIGNATURE-----





view thread (8+ messages)

Message-ID: <93b83a5f4f948719c40b2ecac346c692@biglumber.com>
Permalink:  ../93b83a5f4f948719c40b2ecac346c692@biglumber.com/
Also on:    postgresql.org/message-id/93b83a5f4f948719c40b2ecac346c692@biglumber.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: greg@turnstep.com, twanger@bluetwanger.de
  Subject: Re: getting details about integrity constraint violation
  In-Reply-To: <93b83a5f4f948719c40b2ecac346c692@biglumber.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox