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

Reply via email to