Skip site navigation (1) Skip section navigation (2)

Re: Avoiding bad prepared-statement plans.

From: "Pierre C" <lists(at)peufeu(dot)com>
To: "Dimitri Fontaine" <dfontaine(at)hi-media(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Avoiding bad prepared-statement plans.
Date: 2010-02-18 20:19:21
Message-ID: op.u8caiphxeorkce@localhost (view raw or flat)
Thread:
Lists: pgsql-hackers
> What about catching the error in the application and INSERT'ing into the
> current preprepare.relation table? The aim would be to do that in dev or
> in pre-prod environments, then copy the table content in production.

Yep, but it's a bit awkward and time-consuming, and not quite suited to  
ORM-generated requests since you got to generate all the plan names, when  
the SQL query itself would be the most convenient "unique identifier"...

A cool hack would be something like that :

pg_execute( "SELECT ...", arguments... )

By inserting a hook which calls a user-specified function on non-existing  
plan instead of raising an error, this could work.
However, this wouldn't work as-is since the plan name must be <=  
NAMEDATALEN, but you get the idea ;)

In response to

Responses

pgsql-hackers by date

Next:From: Greg Sabino MullaneDate: 2010-02-18 21:01:29
Subject: Re: [HACKERS] Listen/Notify payload and interfaces
Previous:From: Tom LaneDate: 2010-02-18 19:17:11
Subject: Re: Re: [COMMITTERS] pgsql: Introduce WAL records to log reuse of btree pages, allowing

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group