Re: Planning error in dynamic string creation in plpgsql - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Planning error in dynamic string creation in plpgsql
Date
Msg-id 52CA35F5.3010705@gmail.com
Whole thread Raw
In response to Re: Planning error in dynamic string creation in plpgsql  (Keith Fiske <keith@omniti.com>)
List pgsql-general
On 01/05/2014 08:43 PM, Keith Fiske wrote:
> I can't remove the quote_literal() because the value could potentially
> be a string, time, or number. Without the loop, quote_literal() handles
> the variable being any one of those types without any issues and quotes
> (or doesn't) as needed.

Well I tried it in your example function and it seemed to work. I don't
think it is quote_literal that is the problem, it is the assignment to
v_sql. In the FOREACH it seems v_sql is not being replanned. In the
other loop there two instances of it and they segregated by type at the
start so they do not suffer the planning issue with types.

>
> --
> Keith Fiske
> Database Administrator
> OmniTI Computer Consulting, Inc.
> http://www.keithf4.com


--
Adrian Klaver
adrian.klaver@gmail.com


pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Planning error in dynamic string creation in plpgsql
Next
From: Jayadevan M
Date:
Subject: Re: authentication failure