Search Postgresql Archives

Re: syntax pb

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





The above should have been:

Insert into t2 (a, b, c, d)
Select distinct test1.t, 'abc' as b, NULL::text, NULL::numeric
 From t1 test1;

>
> which results in:
>
> select * from t2;
>     a    |  b  |  c   |  d
> --------+-----+------+------
>   azerty | abc | NULL | NULL
>
>

Thanks Adrian, but if the query becomes more complex, for example with a few joins more, then even casting doesn't work.
This comes from a prod environment and even casting NULLs (which is more than strange, BTW) generates absurd errors.
Too my understanding it looks like the parser did not parse the select distinct as we think he does.

 
>> Marc MILLAS
>> Senior Architect
>> +33607850334
>> www.mokadb.com <http://www.mokadb.com>
>>
>

--
Adrian Klaver
adrian.klaver@xxxxxxxxxxx


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux