pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: furstenheim@gmail.com
To: pgsql-bugs@postgresql.org
Subject: BUG #14176: Re: BUG #14173: Not using partitions with ANY(ARRAY[...])
Date: Fri, 03 Jun 2016 16:14:58 +0000
Message-ID: <20160603161458.9932.4126@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

The following bug has been logged on the website:

Bug reference:      14176
Logged by:          Gabriel f
Email address:      furstenheim@gmail.com
PostgreSQL version: 9.5.3
Operating system:   Linux 64bit
Description:        

This is an answer to
https://www.postgresql.org/message-id/12955.1464963775%40sss.pgh.pa.us 

If the type is an integer then I don't have the problem. However if I use
char(2) then I have it.

create table mtable (mvar char (2));
create table c1 (check (mvar = 'aa')) inherits(mtable);
create table c2 (check (mvar = 'bb')) inherits(mtable);
explain select * from mtable where mvar = 'aa';
'Append (cost=0.00..35.50 rows=11 width=12)'
' -> Seq Scan on mtable (cost=0.00..0.00 rows=1 width=12)'
' Filter: (mvar = 'aa'::bpchar)'
' -> Seq Scan on c1 (cost=0.00..35.50 rows=10 width=12)'
' Filter: (mvar = 'aa'::bpchar)'

explain select * from mtable where mvar = any (array['aa']);
'Append (cost=0.00..76.10 rows=21 width=12)'
' -> Seq Scan on mtable (cost=0.00..0.00 rows=1 width=12)'
' Filter: ((mvar)::text = ANY ('{aa}'::text[]))'
' -> Seq Scan on c1 (cost=0.00..38.05 rows=10 width=12)'
' Filter: ((mvar)::text = ANY ('{aa}'::text[]))'
' -> Seq Scan on c2 (cost=0.00..38.05 rows=10 width=12)'
' Filter: ((mvar)::text = ANY ('{aa}'::text[]))'

Curiously if I use char varying(2) then it works as expected

PS sorry I cannot find how to answer directly to the mail


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


view thread (2+ messages)  latest in thread

Message-ID: <20160603161458.9932.4126@wrigleys.postgresql.org>
Permalink:  ../20160603161458.9932.4126@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20160603161458.9932.4126@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: furstenheim@gmail.com
  Subject: Re: BUG #14176: Re: BUG #14173: Not using partitions with ANY(ARRAY[...])
  In-Reply-To: <20160603161458.9932.4126@wrigleys.postgresql.org>
  References: <20160603161458.9932.4126@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox