Re: BUG #16510: Count Distinct with non distinct column incombination with string constants throws error

Поиск
Список
Период
Сортировка
От Daniel Gustafsson
Тема Re: BUG #16510: Count Distinct with non distinct column incombination with string constants throws error
Дата
Msg-id 97455ED3-B219-43BA-88EF-9CFDAF70E44E@yesql.se
обсуждение исходный текст
Ответ на Re: BUG #16510: Count Distinct with non distinct column in combination with string constants throws error  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #16510: Count Distinct with non distinct column in combination with string constants throws error
Следующее
От: Daniel Gustafsson
Дата:
Сообщение: Re: BUG #16509: Unable to change from 32 bit to 64 bit