ID:               41860
 Updated by:       [EMAIL PROTECTED]
 Reported By:      brian at derocher dot org
-Status:           Open
+Status:           Wont fix
 Bug Type:         PostgreSQL related
 Operating System: Linux
 PHP Version:      5.2.3
 New Comment:

This fix would break backwards compatibility for people relying on the

case-insensetive behavior.


Previous Comments:
------------------------------------------------------------------------

[2007-06-29 23:34:28] brian at derocher dot org

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 [EMAIL PROTECTED] 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 this bug report at http://bugs.php.net/?id=41860&edit=1

Reply via email to