PG_LO_EXPORT(3)PG_LO_EXPORT(3)pg_lo_export - Export a large object to fileSYNOPSIS
bool pg_lo_export ([resource $connection], int $oid, string $pathname)
DESCRIPTION pg_lo_export(3) takes a large object in a PostgreSQL database and saves its contents to a file on the local filesystem.
To use the large object interface, it is necessary to enclose it within a transaction block.
Note
This function used to be called pg_loexport(3).
PARAMETERS
o $connection
- PostgreSQL database connection resource. When $connection is not present, the default connection is used. The default connection
is the last connection made by pg_connect(3) or pg_pconnect(3).
o $oid
- The $OID of the large object in the database.
o $pathname
- The full path and file name of the file in which to write the large object on the client filesystem.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
pg_lo_export(3) example
<?php
$database = pg_connect("dbname=jacarta");
pg_query($database, "begin");
$oid = pg_lo_create($database);
$handle = pg_lo_open($database, $oid, "w");
pg_lo_write($handle, "large object data");
pg_lo_close($handle);
pg_lo_export($database, $oid, '/tmp/lob.dat');
pg_query($database, "commit");
?>
SEE ALSO pg_lo_import(3).
PHP Documentation Group PG_LO_EXPORT(3)
Check Out this Related Man Page
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)
I would like to edit a doc which is large file size. I can't use "vi" command due to out of memory.
$ vi large.dat
ex: 0602-101 Out of memory saving lines for undo.
Please help. Thanks. (2 Replies)
I have a very large database and once in awhile the database auto loading scripts that update the database for the daily updates fails and I have to go in and manually fix it but when that happens I usually have to start from scratch on sundays I have access to a weekly database rebuild. Then I... (3 Replies)
i have a little pro*c code (as shown below)
to connect an oracle database. (in unix solaris platform)
in the preprocessor compilation step everything is ok.
but when i try to compile the code using cc i get the
error below:
ld:
Unresolved:
sqlcxt
i think there is a problem while linking... (3 Replies)
We have a large number of oracle database related scripts that utilize the environment variables $ORACLE_SID and $DBNAME. In a single instance database the $ORACLE_SID is the same as the database name $DBNAME. So we have simply set DBNAME = $ORACLE_SID. However, now that we are clustering with RAC,... (5 Replies)
Hi All
We have got a HUGE process of securing our infrastructure(primarily the database)
We basically establish connection to oracle database from our UNIX shell scripts
when we do ps -ef | grep sqlplus
it blurts out all the credentials as output.
sqplus username/password@server
... (1 Reply)
Hi
I have a small function which returns a wrong value.
The function tries to make a connection to oracle database and tries to get the open_mode of the database in the variable status.
However when a database is down the value of the status column is set to READWRITE i am not sure why.
I... (0 Replies)
Hello,
I have a large database in which name homonyms are arranged in a row. Since the database is large and generated by hand, very often dupes creep in. I want to remove the dupes either using an awk or perl script.
An input is given below
The expected output is given below:
As can be... (2 Replies)
My excuses for a Title which does not really describe what I need.
My OS is Windows Vista/Windows7
I have a large database of homographs with the following structure:
name=name variant
i.e. a variant of a name is provided on a line separated by a =.
An example will make this clear
... (1 Reply)
Hi All,
I am working on a file transfer tool between unix servers.
for this i am looking for a small database which is free and compatible with all unix OS and can be bundled in a package with other scripts.
Any suggestions (8 Replies)