Re: syntax pb

Поиск
Список
Период
Сортировка
От Marc Millas
Тема Re: syntax pb
Дата
Msg-id CADX_1aZCCyHinjZC_W3J3YLNFsFxMW74isxf9WtEYhuCfOhG8Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: syntax pb  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general

Marc MILLAS
Senior Architect
+33607850334



On Tue, May 30, 2023 at 3:51 PM David G. Johnston <david.g.johnston@gmail.com> wrote:
On Tuesday, May 30, 2023, Marc Millas <marc.millas@mokadb.com> wrote:

I get:
ERROR:  column "d" is of type numeric but expression is of type text
LINE 2: Select distinct test1.t, 'abc' as b, NULL as c, NULL as d
                                                   
HINT:  You will need to rewrite or cast the expression.

Can someone give a short SQL syntax hint ?


I plainly agree on that...
but its NOT what's happeninng. The doc you point to states:
"An explicit type cast can usually be omitted if there is no ambiguity as to the type that a value expression must produce (for example, when it is assigned to a table column);"

in the SQL I provide I ask to put a NULL in a numeric column.
Can you tell where the ambiguity is ?

 

David J. 

В списке pgsql-general по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: syntax pb
Следующее
От: Marc Millas
Дата:
Сообщение: Re: syntax pb