pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Daniel Gustafsson <daniel@yesql.se>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: aceonline@gmx.de
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #16510: Count Distinct with non distinct column in combination with string constants throws error
Date: Thu, 25 Jun 2020 16:42:18 +0200
Message-ID: <97455ED3-B219-43BA-88EF-9CFDAF70E44E@yesql.se> (raw)
In-Reply-To: <2270140.1593095554@sss.pgh.pa.us>
References: <16510-755ed3d371542beb@postgresql.org>
	<5CF2CF6C-8951-4CA1-980C-94F369B7EE86@yesql.se>
	<2270140.1593095554@sss.pgh.pa.us>

> On 25 Jun 2020, at 16:32, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> The reason for this might be a little more obvious if you wrote the
> implicit row constructor explicitly, ie
> 
> SELECT COUNT(DISTINCT ROW(testtable.column2, 'blub')) FROM public.testtable;

That's a good point, that's a clearer explanation.

> Perhaps there's room to argue that we should allow 'unknown' to decay to
> 'text' automatically in this context, but I'm not in a big hurry to do
> that.  It seems better to make people be explicit about which datatype
> they intend inside such complex, infrequently-used constructs.

Agreed, it sounds like something that will just work in most cases but run the
risk of introducing subtle bugs in the cases where it doesn't.

cheers ./daniel




view thread (4+ messages)

Message-ID: <97455ED3-B219-43BA-88EF-9CFDAF70E44E@yesql.se>
Permalink:  ../97455ED3-B219-43BA-88EF-9CFDAF70E44E@yesql.se/
Also on:    postgresql.org/message-id/97455ED3-B219-43BA-88EF-9CFDAF70E44E@yesql.se

 · 

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-bugs@postgresql.org
  Cc: daniel@yesql.se, tgl@sss.pgh.pa.us, aceonline@gmx.de
  Subject: Re: BUG #16510: Count Distinct with non distinct column in combination with string constants throws error
  In-Reply-To: <97455ED3-B219-43BA-88EF-9CFDAF70E44E@yesql.se>
  References: <16510-755ed3d371542beb@postgresql.org> <5CF2CF6C-8951-4CA1-980C-94F369B7EE86@yesql.se> <2270140.1593095554@sss.pgh.pa.us> <97455ED3-B219-43BA-88EF-9CFDAF70E44E@yesql.se>

* 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