Subject: Server side large object functions

From: "George Weaver" <[email-masked]>
Date: Thu, 18 Dec 2008 09:58:05 -0600

Hi,

The PostgreSQL manual indicates that:

"There are server-side functions callable from SQL that correspond to each
of the client-side functions described above."

In psql I can get the argument data types for lo_open:

development=# \df+ lo_open
                                                         List of functions
   Schema   |  Name   | Result data type | Argument data types | Volatility
|  O
wner   | Language | Source code |    Description
------------+---------+------------------+---------------------+------------+---
-------+----------+-------------+-------------------
 pg_catalog | lo_open | integer          | oid, integer        | volatile
| po
stgres | internal | lo_open     | large object open
(1 row)

But if I try to find the same for lo_read I get:

development=# \df+ lo_read
                                                 List of functions
 Schema | Name | Result data type | Argument data types | Volatility | Owner
| L
anguage | Source code | Description
--------+------+------------------+---------------------+------------+-------+--
--------+-------------+-------------
(0 rows)

Is there not a server side function for lo_read?  If so, how do I determine
the argument types?

My objective it to read a large object into memory as opposed to exporting 
it to a disk file.

I'm using version 8.3.3, psqlODBC 8.2.2 and vb.net.

Thanks,
George

---

From: Alvaro Herrera <[email-masked]>
Date: Thu, 18 Dec 2008 13:02:07 -0300

> development=# \df+ lo_read

alvherre=# \df loread
                            Listado de funciones
   Schema   | Nombre | Tipo de dato de salida | Tipos de datos de argumentos
------------+--------+------------------------+------------------------------
 pg_catalog | loread | bytea                  | integer, integer
(1 fila)

HTH,

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

---

From: "George Weaver" <[email-masked]>
Date: Thu, 18 Dec 2008 10:15:19 -0600

From: "Alvaro Herrera" <[email-masked]>

>   Schema   | Nombre | Tipo de dato de salida | Tipos de datos de 

Thanks Alvaro.  I didn't think to look for a variation of the function 
name...

As an aside, if I do a PostgreSQL Website search for "loread", I get not 
hits.

George

---

From: Alvaro Herrera <[email-masked]>
Date: Thu, 18 Dec 2008 13:49:45 -0300

> As an aside, if I do a PostgreSQL Website search for "loread", I get not  

Apparently these functions are not documented at all :-(  Most of the
chapter on large objects
http://www.postgresql.org/docs/8.3/static/lo-funcs.html
seems predicated on that one will be using libpq and C.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

---

From: Howard Cole <[email-masked]>
Date: Thu, 18 Dec 2008 17:44:26 +0000

George Weaver wrote:
>
> My objective it to read a large object into memory as opposed to 
> exporting it to a disk file.
>
If you use Npgsql (.NET library) rather than ODBC - there are functions 
for reading large objects into memory.

Howard Cole
www.selestial.com

---

From: "George Weaver" <[email-masked]>
Date: Thu, 18 Dec 2008 12:50:39 -0600

----- Original Message ----- 
From: "Howard Cole" <[email-masked]>

> for reading large objects into memory.

Cool!

I've been meaning to have a look at Npgsql - maybe this is the nudge I need!

Thanks,
George