Search Postgresql Archives

Re: Pulling data from a constraint def

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 11, 2010 at 06:38:59PM -0700, Gauthier, Dave wrote:
> Hi:
> 
> I have a constraint defined on a table....
> 
> constraint design_style_is_invalid check (design_style in
> ('rls','sdp','rf','ssa','rom','rpt','analog','sdprpt','clkdist','global')),
> 
> Is there a way to get the valid values in the list from the metadata
> somehow?

There may be, but you're much better off either creating a small table
design_style with one column of text and making foreign key references
to it.

> Specifically, when someone hits this constraint, I want to
> not oonly tell them they entered an invalid value, but give them the
> list of valid choices at the same time.
> 
> I'd rather not put these in a table and implement with a foreogn key
> constraint for performance reasons. (Does that make sense?)

If you've measured a performance issue for a table that tiny, it's a
bug that needs fixing in PostgreSQL.  What measurements have you done
so far?

Cheers,
David.
-- 
David Fetter <david@xxxxxxxxxx> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@xxxxxxxxx
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux