pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #14176: Re: BUG #14173: Not using partitions with ANY(ARRAY[...])
2+ messages / 2 participants
[nested] [flat]
* BUG #14176: Re: BUG #14173: Not using partitions with ANY(ARRAY[...])
@ 2016-06-03 16:14 furstenheim@gmail.com
0 siblings, 1 reply; 2+ messages in thread
From: furstenheim@gmail.com @ 2016-06-03 16:14 UTC (permalink / raw)
To: pgsql-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
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: BUG #14176: Re: BUG #14173: Not using partitions with ANY(ARRAY[...])
@ 2016-06-03 16:49 Francisco Olarte <folarte@peoplecall.com>
parent: furstenheim@gmail.com
0 siblings, 0 replies; 2+ messages in thread
From: Francisco Olarte @ 2016-06-03 16:49 UTC (permalink / raw)
To: furstenheim@gmail.com; +Cc: pgsql-bugs
Hi:
On Fri, Jun 3, 2016 at 6:14 PM, <furstenheim@gmail.com> wrote:
> If the type is an integer then I don't have the problem. However if I use
> char(2) then I have it.
char tends to do this things. Anyway....
.....
> ' Filter: ((mvar)::text = ANY ('{aa}'::text[]))'
Notice the ::text[]?
> Curiously if I use char varying(2) then it works as expected
Maybe because text[] and varchar[] convert and text[] and char(2)[]
not, you could try to use explicit types ( array['aa'::char(2)] ).
I've seen this happen in other contexts when using char ( unqualified
strings are text, text does not convert that well to char the moment
there is something, like an array[], any() or other function calls,
in the middle ).
> PS sorry I cannot find how to answer directly to the mail
There is alway cut&paste for these things.
Francisco Olarte.
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2016-06-03 16:49 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-06-03 16:14 BUG #14176: Re: BUG #14173: Not using partitions with ANY(ARRAY[...]) furstenheim@gmail.com
2016-06-03 16:49 ` Francisco Olarte <folarte@peoplecall.com>
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