PG_LO_OPEN(3)PG_LO_OPEN(3)pg_lo_open - Open a large objectSYNOPSIS
resource pg_lo_open (resource $connection, int $oid, string $mode)
DESCRIPTION pg_lo_open(3) opens a large object in the database and returns large object resource so that it can be manipulated.
Warning
Do not close the database connection before closing the large object resource.
To use the large object interface, it is necessary to enclose it within a transaction block.
Note
This function used to be called pg_loopen(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 $mode
- Can be either "r" for read-only, "w" for write only or "rw" for read and write.
RETURN VALUES
A large object resource or FALSE on error.
EXAMPLES
Example #1
pg_lo_open(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_close(3), pg_lo_create(3).
PHP Documentation Group PG_LO_OPEN(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)
Hi,
I know very little about C and Unix. I have written a program to use threads. The program needs to get some values from a very large database.
I wrote a simple program and compiled but got the following errors.....
cc mythread.c -lthread
"/usr/include/pthread.h", line 120:... (3 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 ,
I have a configuration file with the following structure:
<CONFIG>
<DEFAULTS operator="oraread">
<PROPERTY name="hostname" value="myhostname"/>
<PROPERTY name="port" value="12343"/>
<PROPERTY name="dbname" value="dbname"/>
<PROPERTY... (0 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)
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)
Good afternoon
i need your help, i am new at unix, in a ETL scenario like datastage is , there are a bunch of procesess (script shells) conecting to hetereogenius database source servers in order to extract information.
Ive got 2 questions
1. Using unix how can i identify exactly the... (1 Reply)
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)
I have found this excellent site: NSRL Downloads
(sorry if it was already mentioned)
there are Solaris and Linux files there too.
its all in a text file, over 11Gb large. (0 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)