pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #14476: crosstabview reports mistaken location
2+ messages / 2 participants
[nested] [flat]

* BUG #14476: crosstabview reports mistaken location
@ 2016-12-25 02:15 t.katsumata1122@gmail.com
  2016-12-25 21:07 ` Re: BUG #14476: crosstabview reports mistaken location Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: t.katsumata1122@gmail.com @ 2016-12-25 02:15 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      14476
Logged by:          Tomonari Katsumata
Email address:      t.katsumata1122@gmail.com
PostgreSQL version: 9.6.1
Operating system:   macOS Sierra 10.12.1
Description:        

Hi,

I'm playing with crosstabview, PostgreSQL9.6 new feature.
And I noticed the error message is not correct when it has duplicate data.

-- How to reproduce -----
create table ctv(x int, y int, v text);
insert into ctv values (1, generate_series(1,10), '*');
insert into ctv values (1, 10, '*'); -- duplicate data
select * from ctv;
\crosstabview
-------------------------

The last 2 statements work like below.

postgres=# select * from ctv;
 x | y  | v
---+----+---
 1 |  1 | *
 1 |  2 | *
 1 |  3 | *
 1 |  4 | *
 1 |  5 | *
 1 |  6 | *
 1 |  7 | *
 1 |  8 | *
 1 |  9 | *
 1 | 10 | *
 1 | 10 | *
(11 rows)

postgres=# \crosstabview
\crosstabview: query result contains multiple data values for row "1",
column "9"


In above case, although there is duplicate data on row(x):1 and
column(y):10,
row(x):1 and column(y):9 is not duplicate.

So I think it should be the message say
  \crosstabview: query result contains multiple data values for row "1",
column "10"


It seems this problem is reproduced when number of row is higher than 10.
Could you check this, please?

Best regards,
-------
Tomonari Katsumata



-- 
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 #14476: crosstabview reports mistaken location
  2016-12-25 02:15 BUG #14476: crosstabview reports mistaken location t.katsumata1122@gmail.com
@ 2016-12-25 21:07 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2016-12-25 21:07 UTC (permalink / raw)
  To: t.katsumata1122@gmail.com; +Cc: pgsql-bugs

t.katsumata1122@gmail.com writes:
> I'm playing with crosstabview, PostgreSQL9.6 new feature.
> And I noticed the error message is not correct when it has duplicate data.

Yup, you're right.

> It seems this problem is reproduced when number of row is higher than 10.

It looks to me like the triggering condition is that the data values
aren't in ASCII (strcmp()) order.  As long as they are, the "pivot value"
array order matches the rank order and so the error message accidentally
selects the appropriate array entries.

Fix pushed, thanks for the report!

			regards, tom lane


-- 
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-12-25 21:07 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-12-25 02:15 BUG #14476: crosstabview reports mistaken location t.katsumata1122@gmail.com
2016-12-25 21:07 ` Tom Lane <tgl@sss.pgh.pa.us>

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