Re: Oid data type question

From: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
To: Farren Isaacs <farren(at)bu(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Oid data type question
Date: 2000-04-13 16:46:06
Message-ID: Pine.LNX.3.96.1000413183642.1989G-100000@ara.zf.jcu.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 13 Apr 2000, Farren Isaacs wrote:

> I'm relatively new to psql. I have created a database with Oid data
> types
> in it. I am now trying to populate the tables with data, from a file
> but
> I am not sure how to get the path names into the Oid fields. I have
> tried
> commands like:
>
> insert into gene values('cI', '1', lo_import('filename1'),
> lo_import('filename2'), 'control');

A lo_xxxxx() in standard query works on backend's host disk only.

a example:

test=# create table tab (data text, lo oid);
CREATE
test=# insert into tab values ('my new data', lo_import('/tmp/aaa'));
INSERT 179545 1
test=# select * from tab;
data | lo
-------------+--------
my new data | 179531
(1 row)

If you want use LO in backend<->frondend connection you must use LO API
(example in C/PHP/Perl..etc) or you can use new (7.0) pgsql client.

Karel

In response to

Browse pgsql-general by date

  From Date Subject
Next Message kaiq 2000-04-13 17:52:48 Re: PostgreSQL (fwd)
Previous Message Thomas Lockhart 2000-04-13 16:43:01 [Fwd: [HACKERS] Porting reports (cont'd)]