Re: passing text value with single quote to stored procedure - Mailing list pgsql-general

From Alban Hertroys
Subject Re: passing text value with single quote to stored procedure
Date
Msg-id AA0ED26E-D8C4-4F9D-88DD-C81384394AA3@gmail.com
Whole thread Raw
In response to passing text value with single quote to stored procedure  (Prabhjot Sheena <prabhjot.sheena@rivalwatch.com>)
List pgsql-general
On Jul 13, 2013, at 24:05, Prabhjot Sheena <prabhjot.sheena@rivalwatch.com> wrote:

> when this value is passed to the function
>
> select load_stage_start_v1('QA_SUMMER'2013_(EU/US)');
>
> This gives an error. Is there a way to fix this issue.

Your issue has nothing to do with stored procedures. You need to escape the string properly for SQL.

select load_stage_start_v1('QA_SUMMER''2013_(EU/US)');


Alban Hertroys
--
If you can't see the forest for the trees,
cut the trees and you'll find there is no forest.



pgsql-general by date:

Previous
From: "shankar.kotamarthy@gmail.com"
Date:
Subject: Re: pg_upgrade could not create catalog dump while upgrading from 9.0 to 9.2
Next
From: Dmitriy Igrishin
Date:
Subject: Re: [HACKERS] Frontend/backend protocol improvements proposal (request).