TRUE;
END IF;
END
$BODY$ LANGUAGE plpgsql;
ALTER TABLE foo ADD CONSTRAINT C_foo_iniq_if_true CHECK (active =
FALSE OR id_is_valid(id));
On 3/5/06, Nikolay Samokhvalov <[EMAIL PROTECTED]> wrote:
> Unfortunately, at the moment Postgres doesn't support subqueries in
> CHECK con
Unfortunately, at the moment Postgres doesn't support subqueries in
CHECK constraints, so it's seems that you should use trigger to check
what you need, smth like this:
CREATE OR REPLACE FUNCTION foo_check() RETURNS trigger AS $BODY$
BEGIN
IF NEW.active = TRUE AND NEW.id IN (
SELECT id
please, show '\d xx_thing_event' too :-)
On 3/3/06, Bryce Nesbitt <[EMAIL PROTECTED]> wrote:
> I'm getting sequential scans (and poor performance), on scans using my
> primary keys.
> Can anyone help figure out why?
>
> demo=# \d xx_thing
> Table "public.xx_thing"
> C
You can try to use this patch:
http://archives.postgresql.org/pgsql-patches/2005-09/msg00138.php
This is implementation of basic functions of SQL/XML (14th part of
SQL:2003, http://www.sqlx.org/)
I've successfully applied it to 8.1 version - no troubles.
On 11/11/05, Warren Murray <[EMAIL PROTEC
Hi,
My knowledge of PostgreSQL's SQL is not good, but I know ISO/ANSI
SQL:2003 (basics) quite well.
I've encountered with following task. I have one SELECT statement with
ORDER BY clause; and know, that result set for this SELECT contains
row with ID = 1000 (just for example).
I don't know the po