Re: Drop or alter column under load give ERROR #42804 structure of query does not match function result type: - Mailing list pgsql-general

From Andres Freund
Subject Re: Drop or alter column under load give ERROR #42804 structure of query does not match function result type:
Date
Msg-id 20151012134852.GB30738@alap3.anarazel.de
Whole thread Raw
In response to Re: Drop or alter column under load give ERROR #42804 structure of query does not match function result type:  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
On 2015-10-12 06:42:52 -0700, Adrian Klaver wrote:
> >My guess is that the problem here is that table level locking prevents
> >modification of the "users" type when the table is used, but there's no
> >locking preventing the columns to be dropped while the function is
> >used. So what happens is that 1) the function is parsed & planned 2)
> >DROP COLUMN is executed 3) the contained statement is executed 4) a
> >mismatch between the contained statement and the function definition is
> >detected.
>
> Except per Albe's[1] example, the above sequence of events does not fail. It
> fails in Victors's case when the server is under load, so it seems there is
> another factor in play.

The above sequence is only problematic if 2) happens exactly between 1)
and 3), which is not particularly likely given that 1) is a very quick
operation.

Greetings,

Andres Freund


pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Drop or alter column under load give ERROR #42804 structure of query does not match function result type:
Next
From: Tom Lane
Date:
Subject: Re: Drop or alter column under load give ERROR #42804 structure of query does not match function result type: