php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #380 Using large objects
Submitted: 1998-05-16 18:46 UTC Modified: 1998-05-18 03:43 UTC
From: avernet at scdi dot org Assigned: eschmid (profile)
Status: Closed Package: PostgreSQL related
PHP Version: 3.0 Release Candidate 4 OS:
Private report: No CVE-ID: None
 [1998-05-16 18:46 UTC] avernet at scdi dot org
To use PostgreSQL large objects from PHP3, you must
include your code in a transaction. This not explained
in the PHP documentation (ok, this a PostgreSQL related
problem but it still would be nice to add a short
description of this issue in the PHP documentation). Here
is a valid PHP code to create a large object in a
PostgreSQL database:

<?
  $database = pg_Connect ("", "", "", "", "jacarta");
  pg_exec ($database, "begin");
  $oid = pg_locreate ($database);
  echo ("$oid\n");
  $handle = pg_loopen ($database, $oid, "w");
  echo ("$handle\n");
  pg_lowrite ($handle, "gaga");
  pg_loclose ($handle);
  pg_exec ($database, "commit");
?>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-05-18 03:43 UTC] eschmid
Example added to the manual. It' s now in the CVS repository at the end 
of the partintro to the pgsql functions

Thanks to Alessandro and Jouni.

-Egon
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 14:01:29 2024 UTC