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@fetter.org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david.fetter@gmail.com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics
Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate