Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pg_lo_write(3) [php man page]

PG_LO_WRITE(3)															    PG_LO_WRITE(3)

pg_lo_write - Write to a large object

SYNOPSIS
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_SEEK(3)															     PG_LO_SEEK(3)

pg_lo_seek - Seeks position within a large object

SYNOPSIS
bool pg_lo_seek (resource $large_object, int $offset, [int $whence = PGSQL_SEEK_CUR]) DESCRIPTION
pg_lo_seek(3) seeks a position within a large object resource. To use the large object interface, it is necessary to enclose it within a transaction block. PARAMETERS
o $large_object - PostgreSQL large object (LOB) resource, returned by pg_lo_open(3). o $offset - The number of bytes to seek. o $whence - One of the constants PGSQL_SEEK_SET (seek from object start), PGSQL_SEEK_CUR (seek from current position) or PGSQL_SEEK_END (seek from object end) . RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 pg_lo_seek(3) example <?php $doc_oid = 189762345; $database = pg_connect("dbname=jacarta"); pg_query($database, "begin"); $handle = pg_lo_open($database, $doc_oid, "r"); // Skip first 50000 bytes pg_lo_seek($handle, 50000, PGSQL_SEEK_SET); // Read the next 10000 bytes $data = pg_lo_read($handle, 10000); pg_query($database, "commit"); echo $data; ?> CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.6.0 | | | | | | | Added PostgreSQL 9.3's 64bit large object sup- | | | port. Both client and server must support Post- | | | greSQL 9.3 and PHP must be 64bit build to use | | | 64bit large object. | | | | +--------+---------------------------------------------------+ SEE ALSO
pg_lo_tell(3). PHP Documentation Group PG_LO_SEEK(3)
Man Page

5 More Discussions You Might Find Interesting

1. AIX

Value too large to be stored in data type???

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)
Discussion started by: limame
5 Replies

2. Programming

Read/Write a fairly large amount of data to a file as fast as possible

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)
Discussion started by: emitrax
3 Replies

3. UNIX for Dummies Questions & Answers

compare 2 very large lists of different length

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)
Discussion started by: uiop44
2 Replies

4. UNIX for Dummies Questions & Answers

get data

Hi friends, I have a large of this similiar data: <INF n="data" z="22" /> I need to get: data 22 please let me know if you can help! (6 Replies)
Discussion started by: bobo
6 Replies

5. Programming

Need help on Insert data to mySQL database

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)
Discussion started by: aoiregion
1 Replies