Re: Constraint using a SQL function executed during SELECT

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Cyril B(dot) <cbay(at)excellency(dot)fr>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Constraint using a SQL function executed during SELECT
Date: 2016-07-19 13:51:02
Message-ID: ff241c0f-b85b-837e-46cf-a6403ff0340f@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 7/19/16 7:43 AM, Cyril B. wrote:
> Hello,
>
> Is there a way to execute a SELECT on a table having a constraint that
> uses a non-working SQL function?
...
> ALTER TABLE ONLY t1 ADD CONSTRAINT c EXCLUDE (id WITH =) WHERE ((f(id)
> IS NOT TRUE));
...
> ERROR: relation "rename_me.t2" does not exist
...
> CONTEXT: SQL function "f" during inlining

In this example, you should be able to avoid that by setting
constraint_exclusion=off.
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532) mobile: 512-569-9461

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Cyril B. 2016-07-19 14:03:10 Re: Constraint using a SQL function executed during SELECT
Previous Message Joshua D. Drake 2016-07-19 13:37:18 Re: MediaWiki + PostgreSQL is not ready for production?