Thread: AW: psql and lo_import

AW: psql and lo_import

From
"berger, ralf"
Date:
Hi,

> -----Ursprüngliche Nachricht-----
> Von: Tom Lane [mailto:tgl@sss.pgh.pa.us]
> Gesendet: Montag, 16. Juli 2001 19:38
> An: berger, ralf
> Cc: pgsql-admin@postgresql.org
> Betreff: Re: [ADMIN] psql and lo_import
>
>
> "berger, ralf" <ralf.berger@ipk.fhg.de> writes:
> > is there any way to use lo_import() in psql?
>
> See \lo_import
>
Sorry this don't work for me!

Because if I type \lo_import() in an insert statement:

INSERT INTO test VALUES ( \lo_import('/home/torsten/bild1.gif') );

I got a list of database owners and the following output:

psql:lo_import.sql:1: \l: extra argument
'o_import('/home/torsten/bild1.gif')' ignored
psql:lo_import.sql:1: ERROR:  parser: parse error at or near ")"

Any hint how to use this?

Thanx
    Ralf

P.S.
My PostgreSQL is 7.0.3 on a Linux box, if this matter.

--
Fraunhofer IPK
Automatisierung und Robotik
Dipl.-Inf. Ralf Berger
Pascalstr. 8-9
10587 Berlin

Tel.: ++49-(0)30 390 06 129
Mobile: ++49-(0)175 52 50 118
Fax.: ++49-(0)30 391 10 37
Web : http://www.ar.ipk.fhg.de
Web : http://www.e-industrial-services.de

---

In anything at all, perfection is finally attained not when
there is no longer anything to add, but when there is
no longer anything to take away.

Antoine de Saint Exupery

Re: AW: psql and lo_import

From
Tom Lane
Date:
"berger, ralf" <ralf.berger@ipk.fhg.de> writes:
> Any hint how to use this?

Get a more recent release...

            regards, tom lane

Re: AW: psql and lo_import

From
Peter Eisentraut
Date:
berger, ralf writes:

> Because if I type \lo_import() in an insert statement:
>
> INSERT INTO test VALUES ( \lo_import('/home/torsten/bild1.gif') );
>
> I got a list of database owners and the following output:
>
> psql:lo_import.sql:1: \l: extra argument
> 'o_import('/home/torsten/bild1.gif')' ignored
> psql:lo_import.sql:1: ERROR:  parser: parse error at or near ")"

\lo_import /home/torsten/bild1.gif
INSERT INTO test VALUES ( :LASTOID );

--
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter