pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Olivier Leprêtre <o.lepretre@gmail.com>
To: 'pgsql-general' <pgsql-general@postgresql.org>
Subject: Strange behavior
Date: Sat, 10 Oct 2020 17:59:11 +0200
Message-ID: <001a01d69f1e$4c006d60$e4014820$@gmail.com> (raw)

Hi,

 

I’m surprised by this behavior I noticed in pgadmin3 and postgresql 9.6

 

Suppose those two tables

create table test1 (v1 text)

create table test2 (v2 text)

insert into test1 (v1) values ('A')

insert into test2 (v2) values ('B')

 

query select v1 from test2 return v2 column doesn’t exists. Right.

 

But the following query does not return any error but only an empty result
set.

select v1 from test1 where v1 not in (select v1 from test2)

 

In other words, a wrong query returns a valid result. This happens because
v1 is a column from test1, (select vx from test2) will return an error as
expected. 

 

Did I missed something ?

 

Thanks,

 

Olivier



-- 
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

view thread (6+ messages)  latest in thread

Message-ID: <001a01d69f1e$4c006d60$e4014820$@gmail.com>
Permalink:  ../001a01d69f1e$4c006d60$e4014820$@gmail.com/
Also on:    postgresql.org/message-id/001a01d69f1e$4c006d60$e4014820$@gmail.com

 · 

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-general@postgresql.org
  Cc: o.lepretre@gmail.com
  Subject: Re: Strange behavior
  In-Reply-To: <001a01d69f1e$4c006d60$e4014820$@gmail.com>
  References: <001a01d69f1e$4c006d60$e4014820$@gmail.com>

* 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