Unix Technical Forum

lo_import

This is a discussion on lo_import within the Pgsql General forums, part of the PostgreSQL category; --> My remote server recognizes the fokkowing expression as a server side command. ----- Insert Into library.devices (Item_id, device, a_d, ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-09-2008, 02:04 PM
Bob Pawley
 
Posts: n/a
Default lo_import

My remote server recognizes the fokkowing expression as a server side command.

-----
Insert Into library.devices (Item_id, device, a_d, designation, function_, type_, function1)
Values ( 'Tdeviceft2a', lo_import('c:/program files/postgresql/8.0/lib/images/magflow.bmp'), 'a', 'F', 'A_Flow', 'mon', 'Flow') ;

---

Various documents, including PostgreSQL, suggest modifications such as - \lo_import, lo_import(), oid lo_import - to make the statement work on the client side.

I can't make them work. What am I missing?

Insert Into library.devices (Item_id, device, a_d, designation, function_, type_, function1)
Values ( 'Tdeviceft2a', \lo_import ('c:/program files/postgresql/8.0/lib/images/magflow.bmp'), 'a', 'F', 'A_Flow', 'mon', 'Flow') ;

Bob Pawley
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-09-2008, 02:04 PM
Joshua D. Drake
 
Posts: n/a
Default Re: lo_import

On Fri, 2006-12-22 at 10:05 -0800, Bob Pawley wrote:
> My remote server recognizes the fokkowing expression as a server side
> command.
>
> -----
> Insert Into library.devices (Item_id, device, a_d, designation,
> function_, type_, function1)
> Values ( 'Tdeviceft2a', lo_import('c:/program
> files/postgresql/8.0/lib/images/magflow.bmp'), 'a', 'F', 'A_Flow',
> 'mon', 'Flow') ;
>


If what you are asking is how can I use lo_import from a remote client,
you can't, unless the file you are importing is on the server.

Joshua D. Drake


> ---
>
> Various documents, including PostgreSQL, suggest modifications such as
> - \lo_import, lo_import(), oid lo_import - to make the statement work
> on the client side.
>
> I can't make them work. What am I missing?
>
> Insert Into library.devices (Item_id, device, a_d, designation,
> function_, type_, function1)
> Values ( 'Tdeviceft2a', \lo_import ('c:/program
> files/postgresql/8.0/lib/images/magflow.bmp'), 'a', 'F', 'A_Flow',
> 'mon', 'Flow') ;
>
> Bob Pawley

--

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate




---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-09-2008, 02:04 PM
Bob Pawley
 
Posts: n/a
Default Re: lo_import

If I can't use lo_import what method do you suggest I use for a large object
(in this case images).

Bob

----- Original Message -----
From: "Joshua D. Drake" <jd@commandprompt.com>
To: "Bob Pawley" <rjpawley@shaw.ca>
Cc: "Postgresql" <pgsql-general@postgresql.org>
Sent: Friday, December 22, 2006 10:12 AM
Subject: Re: [GENERAL] lo_import


> On Fri, 2006-12-22 at 10:05 -0800, Bob Pawley wrote:
>> My remote server recognizes the fokkowing expression as a server side
>> command.
>>
>> -----
>> Insert Into library.devices (Item_id, device, a_d, designation,
>> function_, type_, function1)
>> Values ( 'Tdeviceft2a', lo_import('c:/program
>> files/postgresql/8.0/lib/images/magflow.bmp'), 'a', 'F', 'A_Flow',
>> 'mon', 'Flow') ;
>>

>
> If what you are asking is how can I use lo_import from a remote client,
> you can't, unless the file you are importing is on the server.
>
> Joshua D. Drake
>
>
>> ---
>>
>> Various documents, including PostgreSQL, suggest modifications such as
>> - \lo_import, lo_import(), oid lo_import - to make the statement work
>> on the client side.
>>
>> I can't make them work. What am I missing?
>>
>> Insert Into library.devices (Item_id, device, a_d, designation,
>> function_, type_, function1)
>> Values ( 'Tdeviceft2a', \lo_import ('c:/program
>> files/postgresql/8.0/lib/images/magflow.bmp'), 'a', 'F', 'A_Flow',
>> 'mon', 'Flow') ;
>>
>> Bob Pawley

> --
>
> === The PostgreSQL Company: Command Prompt, Inc. ===
> Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
> Providing the most comprehensive PostgreSQL solutions since 1997
> http://www.commandprompt.com/
>
> Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>



---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-09-2008, 02:04 PM
Joshua D. Drake
 
Posts: n/a
Default Re: lo_import

On Fri, 2006-12-22 at 10:25 -0800, Bob Pawley wrote:
> If I can't use lo_import what method do you suggest I use for a large object
> (in this case images).


It would be helpful if I knew what you were actually trying to do. For
example, perl has the ability to remotely do lo manipulation.

Joshua D. Drake


>
> Bob
>
> ----- Original Message -----
> From: "Joshua D. Drake" <jd@commandprompt.com>
> To: "Bob Pawley" <rjpawley@shaw.ca>
> Cc: "Postgresql" <pgsql-general@postgresql.org>
> Sent: Friday, December 22, 2006 10:12 AM
> Subject: Re: [GENERAL] lo_import
>
>
> > On Fri, 2006-12-22 at 10:05 -0800, Bob Pawley wrote:
> >> My remote server recognizes the fokkowing expression as a server side
> >> command.
> >>
> >> -----
> >> Insert Into library.devices (Item_id, device, a_d, designation,
> >> function_, type_, function1)
> >> Values ( 'Tdeviceft2a', lo_import('c:/program
> >> files/postgresql/8.0/lib/images/magflow.bmp'), 'a', 'F', 'A_Flow',
> >> 'mon', 'Flow') ;
> >>

> >
> > If what you are asking is how can I use lo_import from a remote client,
> > you can't, unless the file you are importing is on the server.
> >
> > Joshua D. Drake
> >
> >
> >> ---
> >>
> >> Various documents, including PostgreSQL, suggest modifications such as
> >> - \lo_import, lo_import(), oid lo_import - to make the statement work
> >> on the client side.
> >>
> >> I can't make them work. What am I missing?
> >>
> >> Insert Into library.devices (Item_id, device, a_d, designation,
> >> function_, type_, function1)
> >> Values ( 'Tdeviceft2a', \lo_import ('c:/program
> >> files/postgresql/8.0/lib/images/magflow.bmp'), 'a', 'F', 'A_Flow',
> >> 'mon', 'Flow') ;
> >>
> >> Bob Pawley

> > --
> >
> > === The PostgreSQL Company: Command Prompt, Inc. ===
> > Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
> > Providing the most comprehensive PostgreSQL solutions since 1997
> > http://www.commandprompt.com/
> >
> > Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
> >
> >
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 6: explain analyze is your friend
> >

>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
>

--

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate




---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-09-2008, 02:04 PM
Bob Pawley
 
Posts: n/a
Default Re: lo_import

I have an interface that I am attempting to connect to a remote database for
which I have only client privileges. ( I would prefer to incorporate all of
this in a single installable .exe file, as the application, as it now
stands, is for mostly single users. But the only method I have found to do
this is to rebuild the database as part of the installataion. Rather than
rebuild, which I think is inefficient, I am looking into building the
database as a remote server.)

Part of the database is an image file using lo_import, which works well on
localhost.

Bob




----- Original Message -----
From: "Joshua D. Drake" <jd@commandprompt.com>
To: "Bob Pawley" <rjpawley@shaw.ca>
Cc: "Postgresql" <pgsql-general@postgresql.org>
Sent: Friday, December 22, 2006 10:32 AM
Subject: Re: [GENERAL] lo_import


> On Fri, 2006-12-22 at 10:25 -0800, Bob Pawley wrote:
>> If I can't use lo_import what method do you suggest I use for a large
>> object
>> (in this case images).

>
> It would be helpful if I knew what you were actually trying to do. For
> example, perl has the ability to remotely do lo manipulation.
>
> Joshua D. Drake
>
>
>>
>> Bob
>>
>> ----- Original Message -----
>> From: "Joshua D. Drake" <jd@commandprompt.com>
>> To: "Bob Pawley" <rjpawley@shaw.ca>
>> Cc: "Postgresql" <pgsql-general@postgresql.org>
>> Sent: Friday, December 22, 2006 10:12 AM
>> Subject: Re: [GENERAL] lo_import
>>
>>
>> > On Fri, 2006-12-22 at 10:05 -0800, Bob Pawley wrote:
>> >> My remote server recognizes the fokkowing expression as a server side
>> >> command.
>> >>
>> >> -----
>> >> Insert Into library.devices (Item_id, device, a_d, designation,
>> >> function_, type_, function1)
>> >> Values ( 'Tdeviceft2a', lo_import('c:/program
>> >> files/postgresql/8.0/lib/images/magflow.bmp'), 'a', 'F', 'A_Flow',
>> >> 'mon', 'Flow') ;
>> >>
>> >
>> > If what you are asking is how can I use lo_import from a remote client,
>> > you can't, unless the file you are importing is on the server.
>> >
>> > Joshua D. Drake
>> >
>> >
>> >> ---
>> >>
>> >> Various documents, including PostgreSQL, suggest modifications such as
>> >> - \lo_import, lo_import(), oid lo_import - to make the statement work
>> >> on the client side.
>> >>
>> >> I can't make them work. What am I missing?
>> >>
>> >> Insert Into library.devices (Item_id, device, a_d, designation,
>> >> function_, type_, function1)
>> >> Values ( 'Tdeviceft2a', \lo_import ('c:/program
>> >> files/postgresql/8.0/lib/images/magflow.bmp'), 'a', 'F', 'A_Flow',
>> >> 'mon', 'Flow') ;
>> >>
>> >> Bob Pawley
>> > --
>> >
>> > === The PostgreSQL Company: Command Prompt, Inc. ===
>> > Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
>> > Providing the most comprehensive PostgreSQL solutions since 1997
>> > http://www.commandprompt.com/
>> >
>> > Donate to the PostgreSQL Project:
>> > http://www.postgresql.org/about/donate
>> >
>> >
>> >
>> >
>> > ---------------------------(end of
>> > broadcast)---------------------------
>> > TIP 6: explain analyze is your friend
>> >

>>
>>
>> ---------------------------(end of broadcast)---------------------------
>> TIP 2: Don't 'kill -9' the postmaster
>>

> --
>
> === The PostgreSQL Company: Command Prompt, Inc. ===
> Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
> Providing the most comprehensive PostgreSQL solutions since 1997
> http://www.commandprompt.com/
>
> Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
>
>
>
>



---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-09-2008, 02:04 PM
Joshua D. Drake
 
Posts: n/a
Default Re: lo_import

On Fri, 2006-12-22 at 10:58 -0800, Bob Pawley wrote:
> I have an interface that I am attempting to connect to a remote database for
> which I have only client privileges. ( I would prefer to incorporate all of
> this in a single installable .exe file, as the application, as it now
> stands, is for mostly single users. But the only method I have found to do
> this is to rebuild the database as part of the installataion. Rather than
> rebuild, which I think is inefficient, I am looking into building the
> database as a remote server.)
>
> Part of the database is an image file using lo_import, which works well on
> localhost.


If it is just images, consider bytea.

Joshua D. Drake


>
> Bob
>
>
>
>
> ----- Original Message -----
> From: "Joshua D. Drake" <jd@commandprompt.com>
> To: "Bob Pawley" <rjpawley@shaw.ca>
> Cc: "Postgresql" <pgsql-general@postgresql.org>
> Sent: Friday, December 22, 2006 10:32 AM
> Subject: Re: [GENERAL] lo_import
>
>
> > On Fri, 2006-12-22 at 10:25 -0800, Bob Pawley wrote:
> >> If I can't use lo_import what method do you suggest I use for a large
> >> object
> >> (in this case images).

> >
> > It would be helpful if I knew what you were actually trying to do. For
> > example, perl has the ability to remotely do lo manipulation.
> >
> > Joshua D. Drake
> >
> >
> >>
> >> Bob
> >>
> >> ----- Original Message -----
> >> From: "Joshua D. Drake" <jd@commandprompt.com>
> >> To: "Bob Pawley" <rjpawley@shaw.ca>
> >> Cc: "Postgresql" <pgsql-general@postgresql.org>
> >> Sent: Friday, December 22, 2006 10:12 AM
> >> Subject: Re: [GENERAL] lo_import
> >>
> >>
> >> > On Fri, 2006-12-22 at 10:05 -0800, Bob Pawley wrote:
> >> >> My remote server recognizes the fokkowing expression as a server side
> >> >> command.
> >> >>
> >> >> -----
> >> >> Insert Into library.devices (Item_id, device, a_d, designation,
> >> >> function_, type_, function1)
> >> >> Values ( 'Tdeviceft2a', lo_import('c:/program
> >> >> files/postgresql/8.0/lib/images/magflow.bmp'), 'a', 'F', 'A_Flow',
> >> >> 'mon', 'Flow') ;
> >> >>
> >> >
> >> > If what you are asking is how can I use lo_import from a remote client,
> >> > you can't, unless the file you are importing is on the server.
> >> >
> >> > Joshua D. Drake
> >> >
> >> >
> >> >> ---
> >> >>
> >> >> Various documents, including PostgreSQL, suggest modifications such as
> >> >> - \lo_import, lo_import(), oid lo_import - to make the statement work
> >> >> on the client side.
> >> >>
> >> >> I can't make them work. What am I missing?
> >> >>
> >> >> Insert Into library.devices (Item_id, device, a_d, designation,
> >> >> function_, type_, function1)
> >> >> Values ( 'Tdeviceft2a', \lo_import ('c:/program
> >> >> files/postgresql/8.0/lib/images/magflow.bmp'), 'a', 'F', 'A_Flow',
> >> >> 'mon', 'Flow') ;
> >> >>
> >> >> Bob Pawley
> >> > --
> >> >
> >> > === The PostgreSQL Company: Command Prompt, Inc. ===
> >> > Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
> >> > Providing the most comprehensive PostgreSQL solutions since 1997
> >> > http://www.commandprompt.com/
> >> >
> >> > Donate to the PostgreSQL Project:
> >> > http://www.postgresql.org/about/donate
> >> >
> >> >
> >> >
> >> >
> >> > ---------------------------(end of
> >> > broadcast)---------------------------
> >> > TIP 6: explain analyze is your friend
> >> >
> >>
> >>
> >> ---------------------------(end of broadcast)---------------------------
> >> TIP 2: Don't 'kill -9' the postmaster
> >>

> > --
> >
> > === The PostgreSQL Company: Command Prompt, Inc. ===
> > Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
> > Providing the most comprehensive PostgreSQL solutions since 1997
> > http://www.commandprompt.com/
> >
> > Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
> >
> >
> >
> >

>

--

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate




---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:11 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com