Re: Checking Multiplicity Constraints and Retrieving Data from Error Messages

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Checking Multiplicity Constraints and Retrieving Data from Error Messages
Дата
Msg-id 20051020120631.GG30631@svana.org
обсуждение исходный текст
Ответ на Re: Checking Multiplicity Constraints and Retrieving Data from Error Messages  (Ledina Hido <lh1101@ecs.soton.ac.uk>)
Список pgsql-general
On Thu, Oct 20, 2005 at 12:44:53PM +0100, Ledina Hido wrote:
> I am not sure if CHECK constraints will work, as I don't think you
> can reference another table in one of those. And I think it might
> even not let you have a subquery (ie a select inside the check
> statement). So I don't know whether I would be able to use CHECK for
> that. Or am I being stupid and you actually can?

Well, you'll need to make a function that does the work and specify
that function as the check constraint. It's true that directly you
can't specify other tables. PostgreSQL can see inside functions to see
what you are doing...

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Douglas McNaught
Дата:
Сообщение: Re: Select all invalid e-mail addresses
Следующее
От: Hannes Dorbath
Дата:
Сообщение: Re: Select all invalid e-mail addresses