Thanks for the explanation. Crystal clear, thanks
Marc MILLAS
Senior Architect
+33607850334
www.mokadb.com
On Tue, May 30, 2023 at 7:31 PM Tom Lane wrote:
> "David G. Johnston" writes:
> > On Tue, May 30, 2023 at 8:53 AM Marc Millas
> wrote
> >> Too my understanding it looks like the parser
Marc MILLAS
Senior Architect
+33607850334
www.mokadb.com
On Tue, May 30, 2023 at 7:12 PM David G. Johnston <
david.g.johns...@gmail.com> wrote:
> On Tue, May 30, 2023 at 8:53 AM Marc Millas wrote
>
>
>> This comes from a prod environment and even casting NULLs (which is more
>> than strange, B
Marc MILLAS
Senior Architect
+33607850334
www.mokadb.com
On Tue, May 30, 2023 at 3:51 PM David G. Johnston <
david.g.johns...@gmail.com> wrote:
> On Tuesday, May 30, 2023, Marc Millas wrote:
>
>>
>> I get:
>> ERROR: column "d" is of type numeric but expression is of type text
>> LINE 2: Selec
On 5/30/23 8:53 AM, Marc Millas wrote:
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 underst
On 5/30/23 10:31 AM, Tom Lane wrote:
"David G. Johnston" writes:
On Tue, May 30, 2023 at 8:53 AM Marc Millas wrote
Too my understanding it looks like the parser did not parse the select
distinct as we think he does.
The DISTINCT clause doesn't really come into play here at all, so if you
t
"David G. Johnston" writes:
> On Tue, May 30, 2023 at 8:53 AM Marc Millas wrote
>> Too my understanding it looks like the parser did not parse the select
>> distinct as we think he does.
> The DISTINCT clause doesn't really come into play here at all, so if you
> think it does you indeed have a
On Tue, May 30, 2023 at 8:53 AM Marc Millas wrote
> This comes from a prod environment and even casting NULLs (which is more
> than strange, BTW) generates absurd errors.
>
If you want an input to be anything other than plain text (numbers
partially exempted) you need to cast it. Sure, some li
On Tue, May 30, 2023 at 05:53:30PM +0200, Marc Millas wrote:
> 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
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
> >
>
On 5/30/23 07:38, Adrian Klaver wrote:
On 5/30/23 06:45, Marc Millas wrote:
Hi,
I always have had difficulties to understand syntax. So...
If I have:
create table t1 (t text);
create table t2 (a text, b text, c test, d numeric);
Is c supposed to be text?
Or are you indeed referring to some u
On 5/30/23 06:45, Marc Millas wrote:
Hi,
I always have had difficulties to understand syntax. So...
If I have:
create table t1 (t text);
create table t2 (a text, b text, c test, d numeric);
Is c supposed to be text?
Or are you indeed referring to some unspecified type?
insert into t1('azert
On 30/05/2023 14:45, Marc Millas wrote:
and , now, if I want to insert that:
Insert into t2 (a, b, c, d)
Select distinct test1.t, 'abc' as b, NULL as c, NULL as d
From t1 test1;
I get:
ERROR: column "d" is of type numeric but expression is of type text
LINE 2: Select distinct test1.t, 'abc' a
On Tuesday, May 30, 2023, Marc Millas 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 hi
13 matches
Mail list logo