Re: BUG #16510: Count Distinct with non distinct column incombination with string constants throws error - Mailing list pgsql-bugs

From Daniel Gustafsson
Subject Re: BUG #16510: Count Distinct with non distinct column incombination with string constants throws error
Date
Msg-id 97455ED3-B219-43BA-88EF-9CFDAF70E44E@yesql.se
Whole thread Raw
In response to Re: BUG #16510: Count Distinct with non distinct column in combination with string constants throws error  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
> 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


pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #16510: Count Distinct with non distinct column in combination with string constants throws error
Next
From: Daniel Gustafsson
Date:
Subject: Re: BUG #16509: Unable to change from 32 bit to 64 bit