Search Postgresql Archives

Re: Escape variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/27/2016 08:57 AM, Jaime Rivera wrote:
Hello,

I've been looking for a way to escape a variable inside a plpgsql stored
procedure just like E works with constants.

For example :

* select E'Se recibi\u00f3 a  \n ci\u00f3n.' *

Returns:

/*Se recibió a  */
/* ción.*/

Something like?:

DO $$
DECLARE
    esc_str varchar;
BEGIN
    esc_str =  E'Se recibi\u00f3 a  \n ci\u00f3n.' ;
    RAISE NOTICE '%', esc_str;
END;
$$ LANGUAGE plpgsql;

NOTICE:  Se recibió a
 ción.
DO

If not then can you show an example from in plpgsql?


Thanks

Jaime





--
Adrian Klaver
adrian.klaver@xxxxxxxxxxx


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux