Home > Archive > PHP SQL > January 2005 > PHP and PostgreSQL large object
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
PHP and PostgreSQL large object
|
|
|
| Hi,
Read code from above...
Do I have to use pg_lo_unlink() to remove imported blob
if "INSERT..." query fails or is it enouhg to make ROLLBACK??
I noticed that db does not loose any size after ROLLBACK
(yes, I have tried to VACUUM it also, size stays same)
Regards
-jori luoto
// CODE
//... openging connection etc...
pg_query($dao,"BEGIN");
$loid = pg_lo_import($dao,"/path/to/file");
if(pg_query($dao,"INSERT INTO lot(loid,name) VALUES ($loid,"name)") ===
false){
pg_query($dao,"ROLLBACK");
}else{
pg_query($dao,"COMMIT);
}
//..closing etc...
| |
|
|
SORRY!!
I was too fast, things works as they should be!!!
VACUUM works when I vacuum whole db (like it have to do when removing blobs)
-jori
Jorch wrote:
> Hi,
>
> Read code from above...
>
> Do I have to use pg_lo_unlink() to remove imported blob
> if "INSERT..." query fails or is it enouhg to make ROLLBACK??
>
> I noticed that db does not loose any size after ROLLBACK
> (yes, I have tried to VACUUM it also, size stays same)
>
> Regards
> -jori luoto
>
> // CODE
>
> //... openging connection etc...
> pg_query($dao,"BEGIN");
>
> $loid = pg_lo_import($dao,"/path/to/file");
>
> if(pg_query($dao,"INSERT INTO lot(loid,name) VALUES ($loid,"name)") ===
> false){
> pg_query($dao,"ROLLBACK");
> }else{
> pg_query($dao,"COMMIT);
> }
>
> //..closing etc...
|
|
|
|
|