Re: BUG #17236: Postgres core on pstate->p_multiassign_exprs - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #17236: Postgres core on pstate->p_multiassign_exprs
Date
Msg-id 1732941.1634609446@sss.pgh.pa.us
Whole thread Raw
In response to BUG #17236: Postgres core on pstate->p_multiassign_exprs  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> Postgres will crash when executing the following SQL:
> CREATE TABLE v0 ( v1 INT , v2 INT ) ; 
> UPDATE v0 SET ( v1 , v2 ) = ( SELECT v2 + 127 , v1 FROM v0 ) , v2 = ( v2 ,
> v1 ) , v1 = 53 , v2 = 54 ;

Hmm, with assertions off I get

ERROR:  column "v2" is of type integer but expression is of type record
LINE 1: ...( v1 , v2 ) = ( SELECT v2 + 127 , v1 FROM v0 ) , v2 = ( v2 ,
                                                                 ^
HINT:  You will need to rewrite or cast the expression.

and if I remove that I get a complaint about multiple assignments
to the same column.

Were you expecting this query to do something useful, or was it
just fuzzing?

(Not that we shouldn't fix the assertion failure.  I'm just
wondering about the context.)

            regards, tom lane



pgsql-bugs by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: Inconsistent behavior of pg_dump/pg_restore on DEFAULT PRIVILEGES
Next
From: Noah Misch
Date:
Subject: Re: CREATE INDEX CONCURRENTLY does not index prepared xact's data