pg_query and COPY in transaction

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have the following code:

pg_query($conn,"BEGIN TRANSACTION;
          DELETE FROM codigo_postal;
          COPY
codigo_postal(codigo_postal,asentamiento,tipo_asentamiento,municipio,estado)
FROM '$tmpfname2' DELIMITER '|';
          COMMIT");

It is suppoused as I understand it, that if an error occurs on the copy
statement, then the codigo_postal table should still have all of the
previous records. Actually I've tested it within psql and it works as
expected.

However, the shown code does not. If an error occurs on the copy
transaction, the data on the table gets deleted.

I'm certainly lost on this one, is it a bug ?, am I doing something
wrong ? (most likely I guess)

Any help will be apprecciated.

PHP: 5.1.2
PostgreSQL: 8.1.4
Apache: 2.0.55
Debian Linux with Kernel 2.6.16


-- 
Luis Magaña
Gnovus Networks & Software
www.gnovus.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux