Re: BUG #12137: ORDER BY with expresion changes the output if added

From: Dmitri Koulikov <koulikoff(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #12137: ORDER BY with expresion changes the output if added
Date: 2014-12-09 11:08:39
Message-ID: 1790156.9ipC5XmESE@hp470
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thursday, December 04, 2014 11:22:21 Tom Lane wrote:

> dima(at)koulikoff(dot)ru writes:
> > The request ...
> > returns Russian names in :name field from the geoname_names table
> > But if I add a line
> > ORDER BY CASE WHEN geoname_names.name IS NOT NULL THEN geoname_names.name
> > ELSE geonames.name END
> > at the end of the request all the values for name are taken from the
> > geonames table.
>
> I can't reproduce any such misbehavior with the given information
> and some made-up data. Can you provide a self-contained test case?
> Or at least EXPLAIN (ANALYZE, VERBOSE) output for both queries?
>
> regards, tom lane

Hello. I've prepared a sample. It turned out that the problem lies in other
place.

In the attachment there is output from explain and a sample

The problem is with ORDER clause I get only one record while without it there
are two.

As I understand this clause should not affect the size of the output.

Tank you in advance. And sorry for the delayed response.

--

With best regards,
Dmitri Koulikoff

mailto:koulikoff(at)gmail(dot)com
skype: dima.koulikoff
phone: +7-495-5052185

Attachment Content-Type Size
pgsql_explain text/plain 8.4 KB
pgsql_sample text/plain 2.9 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Francisco Olarte 2014-12-09 12:19:54 Re: BUG #11986: psql uses pager inside Emacs shell buffer (not a terminal)
Previous Message Mark Kirkwood 2014-12-09 05:58:58 Re: regression, deadlock in high frequency single-row UPDATE