pg_query and COPY in transaction

From: Date: Tue, 18 Jul 2006 17:07:30 +0000
Subject: pg_query and COPY in transaction
Groups: php.general 
Request: Send a blank email to php-general+get-239551@lists.php.net to get a copy of this message
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

« previous php.general (#239551) next »