ID: 42783 Updated by: [EMAIL PROTECTED] Reported By: maciej-php at killer-robot dot net -Status: Open +Status: Assigned Bug Type: PostgreSQL related Operating System: Debian Linux PHP Version: 5.2.4 -Assigned To: +Assigned To: iliaa New Comment:
Ilia, could you take a look at it plz? Previous Comments: ------------------------------------------------------------------------ [2007-09-27 19:38:20] maciej-php at killer-robot dot net Description: ------------ pg_insert() does not accept empty lists of values. Empty lists of values can be useful for tables with defaults set on columns. Postgres provides a construct for inserting an empty list: "INSERT INTO foo DEFAULT VALUES". Reproduce code: --------------- pg_query($conn, 'CREATE TABLE foo (id SERIAL PRIMARY KEY, time TIMESTAMP NOT NULL DEFAULT now())'); var_dump( pg_insert($conn, 'foo', array('time' => '2007-08-08 1:30:00'), PGSQL_DML_STRING)); var_dump( pg_insert($conn, 'foo', array(), PGSQL_DML_STRING)); Expected result: ---------------- string(53) "INSERT INTO foo (time) VALUES ('2007-08-08 1:30:00');" string(30) "INSERT INTO foo DEFAULT VALUES" Actual result: -------------- string(53) "INSERT INTO foo (time) VALUES ('2007-08-08 1:30:00');" bool(false) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=42783&edit=1