Prepared statement invalidation

From: "Daniel Heath" <daniel(at)heath(dot)cc>
To: pgsql-novice(at)lists(dot)postgresql(dot)org
Subject: Prepared statement invalidation
Date: 2021-04-16 00:09:38
Message-ID: eae3cfcd-fe79-4516-b0ff-3872f2880943@www.fastmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi All,

I'm running a site that has a reasonable amount of traffic 24/7 , writes and reads.

I've found that when I add a new column, I sometimes get a spike of errors on the application side due to prepared statement query plans getting invalidated, causing transactions to rollback.

The error is:

ERROR: cached plan must not change result type

Is there a way to make postgres recalculate the query plan instead of failing the transaction when a new column is added?

Thanks,
Daniel Heath

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2021-04-16 00:17:01 Re: Prepared statement invalidation
Previous Message Bzzzz 2021-04-15 13:15:23 Re: Advice on foreign key and cascading delete design - postgresql 12.6