Re: pg_dump and check-constraints

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_dump and check-constraints
Date: 2009-10-01 14:07:11
Message-ID: 18517.1254406031@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"A. Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com> writes:
> test=# create function check_b() returns bool as $$ declare s int; begin select into s sum(i) from b; if s > 3 then return true; else return false; end if; end;$$ language plpgsql;

> test=*# create table a (i int check(check_b()));

This is unsupported, and will fail in *many* situations not only
pg_dump. A check constraint is only expected to examine the current
row of its table.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ricky Tompu Breaky 2009-10-01 15:37:29 Re: I can not drop a user/role because an object depent on it.
Previous Message A. Kretschmer 2009-10-01 13:59:00 pg_dump and check-constraints