pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #13747: Like clause ignoring raws with null value
3+ messages / 3 participants
[nested] [flat]

* BUG #13747: Like clause ignoring raws with null value
@ 2015-10-29 23:08 dtyshecky@gmail.com
  2015-10-30 16:50 ` Re: BUG #13747: Like clause ignoring raws with null value Shulgin, Oleksandr <oleksandr.shulgin@zalando.de>
  2015-10-31 10:54 ` Re: BUG #13747: Like clause ignoring raws with null value Félix GERZAGUET <felix.gerzaguet@gmail.com>
  0 siblings, 2 replies; 3+ messages in thread

From: dtyshecky@gmail.com @ 2015-10-29 23:08 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      13747
Logged by:          Denys Tyshetskyy
Email address:      dtyshecky@gmail.com
PostgreSQL version: 9.2.0
Operating system:   ubuntu
Description:        

I am executing select with like clause on the field X (select * from table
where x like '%ABC%')

In result I don't receive the raws with null in X column so I have to
manually state (where X is null or X like ...)

I would expect to receive columns with null.


-- 
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] 3+ messages in thread

* Re: BUG #13747: Like clause ignoring raws with null value
  2015-10-29 23:08 BUG #13747: Like clause ignoring raws with null value dtyshecky@gmail.com
@ 2015-10-30 16:50 ` Shulgin, Oleksandr <oleksandr.shulgin@zalando.de>
  1 sibling, 0 replies; 3+ messages in thread

From: Shulgin, Oleksandr @ 2015-10-30 16:50 UTC (permalink / raw)
  To: dtyshecky@gmail.com; +Cc: pgsql-bugs

On Fri, Oct 30, 2015 at 12:08 AM, <dtyshecky@gmail.com> wrote:

> The following bug has been logged on the website:
>
> Bug reference:      13747
> Logged by:          Denys Tyshetskyy
> Email address:      dtyshecky@gmail.com
> PostgreSQL version: 9.2.0
> Operating system:   ubuntu
> Description:
>
> I am executing select with like clause on the field X (select * from table
> where x like '%ABC%')
>
> In result I don't receive the raws with null in X column so I have to
> manually state (where X is null or X like ...)
>
> I would expect to receive columns with null.
>

But why?  I would understand if your pattern was '%', but it's really
strange to expect that with the pattern you've shown.

--
Alex

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #13747: Like clause ignoring raws with null value
  2015-10-29 23:08 BUG #13747: Like clause ignoring raws with null value dtyshecky@gmail.com
@ 2015-10-31 10:54 ` Félix GERZAGUET <felix.gerzaguet@gmail.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Félix GERZAGUET @ 2015-10-31 10:54 UTC (permalink / raw)
  To: dtyshecky@gmail.com; +Cc: pgsql-bugs

On Fri, Oct 30, 2015 at 12:08 AM, <dtyshecky@gmail.com> wrote:

> I am executing select with like clause on the field X (select * from table
> where x like '%ABC%')
>
> In result I don't receive the raws with null in X column so I have to
> manually state (where X is null or X like ...)
>
> I would expect to receive columns with null.
>

I don't understand your reasons either, but you can achieve what you want
with:

select * from table where coalesce(x, 'ABC') like '%ABC%'

but I find that less clear (and maybe a little bit less performant than)
than:

select * from table where x like '%ABC%' or x is null

--
Félix

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2015-10-31 10:54 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-10-29 23:08 BUG #13747: Like clause ignoring raws with null value dtyshecky@gmail.com
2015-10-30 16:50 ` Shulgin, Oleksandr <oleksandr.shulgin@zalando.de>
2015-10-31 10:54 ` Félix GERZAGUET <felix.gerzaguet@gmail.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