PG_LO_WRITE(3)PG_LO_WRITE(3)pg_lo_write - Write to a large objectSYNOPSIS
int pg_lo_write (resource $large_object, string $data, [int $len])
DESCRIPTION pg_lo_write(3) writes data into a large object at the current seek position.
To use the large object interface, it is necessary to enclose it within a transaction block.
Note
This function used to be called pg_lowrite(3).
PARAMETERS
o $large_object
- PostgreSQL large object (LOB) resource, returned by pg_lo_open(3).
o $data
- The data to be written to the large object. If $len is specified and is less than the length of $data, only $len bytes will be
written.
o $len
- An optional maximum number of bytes to write. Must be greater than zero and no greater than the length of $data. Defaults to the
length of $data.
RETURN VALUES
The number of bytes written to the large object, or FALSE on error.
EXAMPLES
Example #1
pg_lo_write(3) example
<?php
$doc_oid = 189762345;
$data = "This will overwrite the start of the large object.";
$database = pg_connect("dbname=jacarta");
pg_query($database, "begin");
$handle = pg_lo_open($database, $doc_oid, "w");
$data = pg_lo_write($handle, $data);
pg_query($database, "commit");
?>
SEE ALSO pg_lo_create(3), pg_lo_open(3).
PHP Documentation Group PG_LO_WRITE(3)
Check Out this Related Man Page
PG_LO_CLOSE(3)PG_LO_CLOSE(3)pg_lo_close - Close a large objectSYNOPSIS
bool pg_lo_close (resource $large_object)
DESCRIPTION pg_lo_close(3) closes a large object. $large_object is a resource for the large object from pg_lo_open(3).
To use the large object interface, it is necessary to enclose it within a transaction block.
Note
This function used to be called pg_loclose(3).
PARAMETERS
o $result
- PostgreSQL large object (LOB) resource, returned by pg_lo_open(3).
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
pg_lo_close(3) example
<?php
$database = pg_connect("dbname=jacarta");
pg_query($database, "begin");
$oid = pg_lo_create($database);
echo "$oid
";
$handle = pg_lo_open($database, $oid, "w");
echo "$handle
";
pg_lo_write($handle, "large object data");
pg_lo_close($handle);
pg_query($database, "commit");
?>
SEE ALSO pg_lo_open(3), pg_lo_create(3), pg_lo_import(3).
PHP Documentation Group PG_LO_CLOSE(3)
Hello,
I get this message : "Value too large to be stored in data type" when I try to open a 3Gb file.
Can someone helps me to resolve the problem.
Thank you very much (5 Replies)
Hi,
I'm trying to figure out the best solution to the following problem, and I'm not
yet that much experienced like you. :-)
Basically I have to read a fairly large file, composed of "messages" , in order
to display all of them through an user interface (made with QT).
The messages that... (3 Replies)
I have two very large datasets (>100MB) in a simple vertical list format. They are of different size and with different order and formatting (e.g. whitespace and some other minor cruft that would thwart easy regex).
Let's call them set1 and set2.
I want to check set2 to see if it contains... (2 Replies)
Hi guys, I would like to seek help on inserting data whenever the switch is on or off to my sensor mySQL database in phpMyAdmin from my control.php. I'm using Raspberry PI as my hardware and follow a few tutorials to create my own Web Control Interface, it works perfectly without insert method.... (1 Reply)