Re: [BUGS] BUG #14715: Constraint exclusion isn't used in functionusing language sql - Mailing list pgsql-bugs

From Kyotaro HORIGUCHI
Subject Re: [BUGS] BUG #14715: Constraint exclusion isn't used in functionusing language sql
Date
Msg-id 20170623.103957.31224862.horiguchi.kyotaro@lab.ntt.co.jp
Whole thread Raw
In response to [BUGS] BUG #14715: Constraint exclusion isn't used in function usinglanguage sql  (cliveevans@ntlworld.com)
Responses Re: [BUGS] BUG #14715: Constraint exclusion isn't used in functionusing language sql  (Clive Evans <cliveevans@ntlworld.com>)
List pgsql-bugs
Hello,

At Wed, 21 Jun 2017 14:00:56 +0000, cliveevans@ntlworld.com wrote in
<20170621140056.27883.82221@wrigleys.postgresql.org>
> PostgreSQL version: 9.6.3
...
> The same query written using PL/PGSQL will only scan the expected partition
> tables.

The two are different in that the parameters of the PL/PgSQL
function are regarded as constants at the time of planning of the
inner SQL statement, while those of the SQL function are
not. Constraint exclusion is considered while planning so the SQL
function doesn't get benefit of it.

This doesn't seem a bug, but I couldn't find such a description
in the documentation, though. Maybe it should be here.

https://www.postgresql.org/docs/9.6/static/ddl-partitioning.html#DDL-PARTITIONING-CAVEATS

regareds,

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

pgsql-bugs by date:

Previous
From: Amit Langote
Date:
Subject: Re: [BUGS] Beta 10 parser error for CREATE STATISTICS IF NOT EXISTS
Next
From: Clive Evans
Date:
Subject: Re: [BUGS] BUG #14715: Constraint exclusion isn't used in functionusing language sql