Issue of upgrading from 9.0.4 to 9.1.3

Started by Zhidong Shealmost 14 years ago4 messagesgeneral
Jump to latest
#1Zhidong She
zhidong.she@gmail.com

Hi All,

We used 9.0.4 before and recently we plan to upgrade to 9.1.3. During
the test, we found a issue related to escape letter as below:

in 9.0.4, the sql is correct
insert into test values('abc\'a');

but in 9.1.3, the postgresql denied the same sql, then it worked after
I changed it to
insert into test values('abc''a');

How to configure 9.1.3 and let it also accept \ as the escpage? Could
someone help me out?

thanks very much.

#2John R Pierce
pierce@hogranch.com
In reply to: Zhidong She (#1)
Re: Issue of upgrading from 9.0.4 to 9.1.3

On 04/12/12 11:09 PM, Zhidong She wrote:

but in 9.1.3, the postgresql denied the same sql, then it worked after
I changed it to
insert into test values('abc''a');

How to configure 9.1.3 and let it also accept \ as the escpage? Could
someone help me out?

use E'abc\'a', this is the SQL standard for escaped strings.

or even better, use $$ quoting, like $$abc'a$$

--
john r pierce N 37, W 122
santa cruz ca mid-left coast

#3Raghavendra
raghavendra.rao@enterprisedb.com
In reply to: Zhidong She (#1)
Re: Issue of upgrading from 9.0.4 to 9.1.3

On Fri, Apr 13, 2012 at 11:39 AM, Zhidong She <zhidong.she@gmail.com> wrote:

Hi All,

We used 9.0.4 before and recently we plan to upgrade to 9.1.3. During
the test, we found a issue related to escape letter as below:

in 9.0.4, the sql is correct
insert into test values('abc\'a');

but in 9.1.3, the postgresql denied the same sql, then it worked after
I changed it to
insert into test values('abc''a');

How to configure 9.1.3 and let it also accept \ as the escpage? Could
someone help me out?

thanks very much.

-bash-4.1$ ./psql
psql (9.1.3)
Type "help" for help.

postgres=# select version();
version
--------------------------------------------------------------------------------------------------------------
PostgreSQL 9.1.3 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.4.6
20110731 (Red Hat 4.4.6-3), 64-bit
(1 row)

postgres=# select E'Raghav\'s';
?column?
----------
Raghav's
(1 row)

or

change the parameter standard_confirming_strings to off; and retry your
example.

---
Regards,
Raghavendra
EnterpriseDB Corporation
Blog: http://raghavt.blogspot.com/

Show quoted text

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

#4Raghavendra
raghavendra.rao@enterprisedb.com
In reply to: Zhidong She (#1)
Re: Issue of upgrading from 9.0.4 to 9.1.3

On Sat, Apr 14, 2012 at 6:25 AM, Zhidong She <zhidong.she@gmail.com> wrote:

thanks, tuning standard_confirming_strings to off make our legacy
software smoothly upgrade to 9.1.3.

Turning to OFF should be good.

is there any bad effect if we just sets this params off and not modify
our leacy code to standard E('\sd')?

Nope. Check out the below link under heading "Basic Compatibility Issues"
for your reference.

http://wiki.postgresql.org/wiki/What&#39;s_new_in_PostgreSQL_9.1
---
Regards,
Raghavendra
EnterpriseDB Corporation
Blog: http://raghavt.blogspot.com/

Show quoted text

On Fri, Apr 13, 2012 at 2:19 PM, Raghavendra
<raghavendra.rao@enterprisedb.com> wrote:

On Fri, Apr 13, 2012 at 11:39 AM, Zhidong She <zhidong.she@gmail.com>

wrote:

Hi All,

We used 9.0.4 before and recently we plan to upgrade to 9.1.3. During
the test, we found a issue related to escape letter as below:

in 9.0.4, the sql is correct
insert into test values('abc\'a');

but in 9.1.3, the postgresql denied the same sql, then it worked after
I changed it to
insert into test values('abc''a');

How to configure 9.1.3 and let it also accept \ as the escpage? Could
someone help me out?

thanks very much.

-bash-4.1$ ./psql
psql (9.1.3)
Type "help" for help.

postgres=# select version();
version

--------------------------------------------------------------------------------------------------------------

PostgreSQL 9.1.3 on x86_64-unknown-linux-gnu, compiled by gcc (GCC)

4.4.6

20110731 (Red Hat 4.4.6-3), 64-bit
(1 row)

postgres=# select E'Raghav\'s';
?column?
----------
Raghav's
(1 row)

or

change the parameter standard_confirming_strings to off; and retry your
example.

---
Regards,
Raghavendra
EnterpriseDB Corporation
Blog: http://raghavt.blogspot.com/

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