note 15709 modified in function.pg-loexport by yohgaki

From: Date: Fri, 07 Dec 2001 12:37:43 +0000
Subject: note 15709 modified in function.pg-loexport by yohgaki
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-21869@lists.php.net to get a copy of this message
After hours of headache, I finally realised that pg_loexport sometimes returns true even if the BLOB was not exported. I worked around the problem by changing the code to pg_exec("BEGIN"); pg_loexport($bloboid,$filename,$dblink); pg_exec("COMMIT"); if(!file_exists($filename)) { //deal with non-existent file } The only way i could get pg_loexport to return FALSE was to alter the file permissions on the directory in which the BLOB was being written. Be Warned!!! [Editor's Note] PostgreSQL requires transaction for handling large objects. --was-- After hours of headache, I finally realised that pg_loexport sometimes returns true even if the BLOB was not exported. I worked around the problem by changing the code to pg_exec("BEGIN"); pg_loexport($bloboid,$filename,$dblink); pg_exec("COMMIT"); if(!file_exists($filename)) { //deal with non-existent file } The only way i could get pg_loexport to return FALSE was to alter the file permissions on the directory in which the BLOB was being written. Be Warned!!! http://www.php.net/manual/en/function.pg-loexport.php

« previous php.notes (#21869) next »