Re: Select query regarding info

From: Bill Moran <wmoran(at)potentialtech(dot)com>
To: "Yogesh(dot) Sharma" <Yogesh1(dot)Sharma(at)nectechnologies(dot)in>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Select query regarding info
Date: 2015-06-18 10:37:13
Message-ID: 20150618063713.587fd31b344e793b9ef6d66b@potentialtech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 18 Jun 2015 07:29:37 +0000
"Yogesh. Sharma" <Yogesh1(dot)Sharma(at)nectechnologies(dot)in> wrote:

> HI Everyone,
>
> Below DB query is showing below error on postgresql9.3.
> SELECT '\'' || t2.name || '\'', '\'' || t1.phone_number || '\'', '\'' || t1.details || '\'', '\'' || t1.description || '\'', '\'' || (CASE WHEN t1.s_id IS NULL THEN 'N/A' ELSE t3.s_type END) || '\'', '\'' || t1.s_id || '\'' FROM abc_tble AS t1 LEFT JOIN pqrtable AS t2 ON t1.s_id = nid LEFT JOIN te AS t3 ON t1.s_id = t3.s_id;
> Invalid command \''. Try \? for help.
> But Above query is working fine in postgresql8.3.
> Solution is provided by someone:-
> The SQL standard defines two single quotes to escape one inside a literal: ''''
> Postgres 8.3 defaulted to a non-standard behavior where it was allowed to escape a single quote using a backslash: '\''
> This deviation from the SQL standard was always discouraged and can be controlled through the configuration parameter standard_conforming_strings<http://www.postgresql.org/docs/current/static/runtime-config-compatible.html#GUC-STANDARD-CONFORMING-STRINGS>
> With version 9.1 the default for this parameter was changed from off to on. Version 8.1 and later would emit a warning when you used the non-standard way of escaping single quotes (unless you explicitly turned that off)
>
>
> Could you please provide below information.
> How to change standard_conforming_strings value of postgresql.conf? I have checked but this option is not found in postgresql.conf.

Add it to the file.

Also, don't reply to unrelated threads with new questions, a lot of
people won't see your question if you do that, and if nobody sees
your question you won't get an answer.

--
Bill Moran

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Simon Riggs 2015-06-18 10:51:34 Re: serialization failure why?
Previous Message Filipe Pina 2015-06-18 10:36:49 Re: serialization failure why?