Thread: [SQLObject] Postgres 7, anyone?
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Oleg B. <ph...@ph...> - 2007-07-25 14:51:06
|
Hello. Are here Postgres users who haven't switched to PostgreSQL 8.+? The problem is that Postgres 8+ changed quoting style from \' to '', and it's impossible for SQLObject to support both styles simultaneously, so if everyone has upgraded I will change quoting style in the trunk to ''. Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
From: Fred C <bs...@gm...> - 2007-07-25 15:22:55
|
I use PostgreSQL 8 and everything works fine with SQLObject. For the =20 quotes PostgreSQL support both syntaxes. This is from the reference manual. 4.1.2.1. String Constants A string constant in SQL is an arbitrary sequence of characters =20 bounded by single quotes (=92), for example =92This is a string=92. The =20= standard-compliant way of writing a single-quote character within a =20 string constant is to write two adjacent single quotes, e.g. =20 =92Dianne=94s horse=92. PostgreSQL also allows single quotes to be = escaped =20 with a backslash (\), so for example the same string could be written =20= =92Dianne\=92s horse=92. -fred- On Jul 25, 2007, at 7:51 AM, Oleg Broytmann wrote: > Hello. > > Are here Postgres users who haven't switched to PostgreSQL 8.+? The > problem is that Postgres 8+ changed quoting style from \' to '', =20 > and it's > impossible for SQLObject to support both styles simultaneously, so if > everyone has upgraded I will change quoting style in the trunk to ''. > > Oleg. > --=20 > Oleg Broytmann http://phd.pp.ru/ =20 > ph...@ph... > Programmers don't die, they just GOSUB without RETURN. > > ----------------------------------------------------------------------=20= > --- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a =20 > browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > sqlobject-discuss mailing list > sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss |
From: Oleg B. <ph...@ph...> - 2007-07-25 15:28:57
|
On Wed, Jul 25, 2007 at 08:22:34AM -0700, Fred C wrote: > I use PostgreSQL 8 and everything works fine with SQLObject. For the > quotes PostgreSQL support both syntaxes. 8.2? 8.3? > This is from the reference manual. > > 4.1.2.1. String Constants "A string constant in SQL is an arbitrary sequence of characters bounded by single quotes ('), for example 'This is a string'. The standard-compliant way of writing a single-quote character within a string constant is to write two adjacent single quotes, e.g. 'Dianne''s horse'. PostgreSQL also allows single quotes to be escaped with a backslash (\'). HOWEVER, FUTURE VERSIONS OF POSTGRESQL WILL NOT ALLOW THIS" (Uppercased by me.) Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
From: Fred C <bs...@gm...> - 2007-07-25 16:44:06
|
Right now I am using 8.2 on FreeBSD. postgresql-client-8.2.4 PostgreSQL database (client) postgresql-server-8.2.4_1 The most advanced open-source database available anywhere -fred- On Jul 25, 2007, at 8:29 AM, Oleg Broytmann wrote: > On Wed, Jul 25, 2007 at 08:22:34AM -0700, Fred C wrote: >> I use PostgreSQL 8 and everything works fine with SQLObject. For the >> quotes PostgreSQL support both syntaxes. > > 8.2? 8.3? > >> This is from the reference manual. >> >> 4.1.2.1. String Constants > > "A string constant in SQL is an arbitrary sequence of characters > bounded > by single quotes ('), for example 'This is a string'. The > standard-compliant way of writing a single-quote character within a > string > constant is to write two adjacent single quotes, e.g. 'Dianne''s > horse'. > PostgreSQL also allows single quotes to be escaped with a backslash > (\'). > HOWEVER, FUTURE VERSIONS OF POSTGRESQL WILL NOT ALLOW THIS" > > (Uppercased by me.) > > Oleg. > -- > Oleg Broytmann http://phd.pp.ru/ > ph...@ph... > Programmers don't die, they just GOSUB without RETURN. |
From: Oleg B. <ph...@ph...> - 2007-07-25 15:49:59
|
On Wed, Jul 25, 2007 at 08:34:37AM -0700, Fred C wrote: > Right now I am using 8.2 on FreeBSD. There is a bug report at the SF tracker: https://sourceforge.net/tracker/index.php?func=detail&aid=1759920&group_id=74338&atid=540672 about Pg 8.2.3 on Darwin. It seems Pg 8.2 on Darwin forbid \' style. Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
From: Fred C <bs...@gm...> - 2007-07-25 16:35:25
|
Why not change SQLObject to used '' instead of \' since it is the SQL standard way to write a single quote. The other databases seems to support this syntax. fred[601]> sqlite3 SQLite version 3.3.4 Enter ".help" for instructions sqlite> create table foo (bar char(32)); sqlite> insert into foo (bar) values ('it''s a test'); sqlite> select * from foo; it's a test sqlite> -bash-2.05b$ mysql test Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1879846 to server version: 4.1.15 Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> create table foo (bar char(32)); Query OK, 0 rows affected (0.05 sec) mysql> insert into foo (bar) values ('it''s a test'); Query OK, 1 row affected (0.01 sec) mysql> select * from foo; +-------------+ | bar | +-------------+ | it's a test | +-------------+ 1 row in set (0.00 sec) On Jul 25, 2007, at 8:49 AM, Oleg Broytmann wrote: > On Wed, Jul 25, 2007 at 08:34:37AM -0700, Fred C wrote: >> Right now I am using 8.2 on FreeBSD. > > There is a bug report at the SF tracker: > https://sourceforge.net/tracker/index.php? > func=detail&aid=1759920&group_id=74338&atid=540672 > about Pg 8.2.3 on Darwin. It seems Pg 8.2 on Darwin forbid \' > style. > > Oleg. > -- > Oleg Broytmann http://phd.pp.ru/ > ph...@ph... > Programmers don't die, they just GOSUB without RETURN. |
From: Oleg B. <ph...@ph...> - 2007-07-25 16:27:31
|
On Wed, Jul 25, 2007 at 09:13:22AM -0700, Fred C wrote: > Why not change SQLObject to used '' instead of \' since it is the SQL > standard way to write a single quote. This is exactly what I want to do. I thought PostgreSQL before 8.0 didn't support '' style quoting but I was wrong, even Pg 7.3 supports it: http://www.postgresql.org/docs/7.3/static/sql-syntax.html "SQL allows single quotes to be embedded in strings by typing two adjacent single quotes (e.g., 'Dianne''s horse'). In PostgreSQL single quotes may alternatively be escaped with a backslash ("\", e.g., 'Dianne\'s horse')." That closes the issue. Thank you for forcing me to look into the docs! ;) Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
From: Jorge G. <jg...@gm...> - 2007-07-26 00:39:22
|
Oleg Broytmann wrote: > On Wed, Jul 25, 2007 at 08:22:34AM -0700, Fred C wrote: >> I use PostgreSQL 8 and everything works fine with SQLObject. For the >> quotes PostgreSQL support both syntaxes. > > 8.2? 8.3? Works with 8.2.4 to me. |