#41860 [NEW]: Identifiers should be double quoted
| From: | brian at derocher dot org | Date: | Fri, 29 Jun 2007 23:34:28 +0000 |
| Subject: | #41860 [NEW]: Identifiers should be double quoted | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-114475@lists.php.net to get a copy of this message | ||
From: brian at derocher dot org
Operating system: Linux
PHP version: 5.2.3
PHP Bug Type: PostgreSQL related
Bug description: Identifiers should be double quoted
Description:
------------
Quoting table names and other identifiers is needed because they are
case-sensitive in PostgreSQL. As Marco pointed out reserved words
also need to be quoted.
See section 4.1.1. Identifiers and Key Words
http://www.postgresql.org/docs/8.1/static/sql-syntax.html#SQL-SYNTAX-IDENTIFIERS
I'm not sure why sniper@php.net marked bug #28020 as bodus 3 years
ago.
Reproduce code:
---------------
$Conn = pg_connect( "dbname=db" );
pg_query( $Conn, "insert into \"caseTest\" (foo) values (2)" ); // works
//pg_query( $Conn, "insert into caseTest (foo) values (2)" ); // fails
correctly
echo pg_insert( $Conn, 'caseTest', array( 'foo' => 1 ), PGSQL_DML_STRING
);
// INSERT INTO caseTest (foo) VALUES (1);
if (pg_insert( $Conn, 'caseTest', array( 'foo' => 1 ) ))
echo 'success';
else
echo 'failure';
Expected result:
----------------
INSERT INTO caseTest (foo) VALUES (1);success
db=# select * from "caseTest";
foo
-----
2
1
(2 rows)
Actual result:
--------------
INSERT INTO caseTest (foo) VALUES (1);failure
db=# select * from "caseTest";
foo
-----
2
(1 row)
--
Edit bug report at http://bugs.php.net/?id=41860&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41860&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41860&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41860&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=41860&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=41860&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=41860&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=41860&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=41860&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=41860&r=support
Expected behavior: http://bugs.php.net/fix.php?id=41860&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=41860&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=41860&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=41860&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41860&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=41860&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=41860&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=41860&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=41860&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=41860&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=41860&r=mysqlcfg