pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
large objects
13+ messages / 9 participants
[nested] [flat]

* large objects
@ 1998-07-17 06:39 dwalker@eskimo.com
  0 siblings, 0 replies; 13+ messages in thread

From: dwalker@eskimo.com @ 1998-07-17 06:39 UTC (permalink / raw)
  To: pgsql-interfaces

I'm trying to use lo_open, lo_read, etc. to store large objects in
PostgreSQL 6.3.2.

Here's an error message from trying to call lo_open.

Tk::Error: Can't locate DBI object method "lo_open" via package 
"DBD::Pg::db" at ptkpg line 564.

Can anyone shed some light on this problem or send some working
examples? 

Is it caused because I connected to the database with the DBI function 
instead of the DBD one?

Thanks

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
     David Walker          !            	World Wide Web
  dwalker@eskimo.com       !           <http://www.eskimo.com/~dwalker/;
			   !	      <ftp://ftp.eskimo.com/u/d/dwalker/;



^ permalink  raw  reply  [nested|flat] 13+ messages in thread

* large objects
@ 1998-07-27 07:21 Aleksey Demakov <avd@gcom.ru>
  1998-07-27 09:48 ` Re: [INTERFACES] large objects Peter T Mount <peter@retep.org.uk>
  0 siblings, 1 reply; 13+ messages in thread

From: Aleksey Demakov @ 1998-07-27 07:21 UTC (permalink / raw)
  To: pgsql-interfaces


I'm working on a project where there is a need to store large texts in
a database. I thought that postgres' large object are good for this.
But one my fellow said me that current large object implementation is
very unefficient. So having, say, several thousands of large objects
is impractical. Is this true?

Thanks in advance

Aleksey

-- 
Aleksey Demakov
avd@gcom.ru



^ permalink  raw  reply  [nested|flat] 13+ messages in thread

* Re: [INTERFACES] large objects
  1998-07-27 07:21 large objects Aleksey Demakov <avd@gcom.ru>
@ 1998-07-27 09:48 ` Peter T Mount <peter@retep.org.uk>
  1998-07-27 11:55   ` Re: [INTERFACES] large objects Aleksey Demakov <avd@gcom.ru>
  0 siblings, 1 reply; 13+ messages in thread

From: Peter T Mount @ 1998-07-27 09:48 UTC (permalink / raw)
  To: Aleksey Demakov <avd@gcom.ru>; +Cc: pgsql-interfaces

On 27 Jul 1998, Aleksey Demakov wrote:

> 
> I'm working on a project where there is a need to store large texts in
> a database. I thought that postgres' large object are good for this.
> But one my fellow said me that current large object implementation is
> very unefficient. So having, say, several thousands of large objects
> is impractical. Is this true?

The current implementation has a few problems.

The object is stored using a table/index pair, and takes up more disk
space than a single object.

I haven't tried several thousand objects (yet). I'm working on large
objects today, so I'll try to create a few thousand, and see what happens.

-- 
Peter T Mount peter@retep.org.uk or petermount@earthling.net
Main Homepage: http://www.retep.org.uk
************ Someday I may rebuild this signature completely ;-) ************
Work Homepage: http://www.maidstone.gov.uk Work EMail: peter@maidstone.gov.uk




^ permalink  raw  reply  [nested|flat] 13+ messages in thread

* Re: [INTERFACES] large objects
  1998-07-27 07:21 large objects Aleksey Demakov <avd@gcom.ru>
  1998-07-27 09:48 ` Re: [INTERFACES] large objects Peter T Mount <peter@retep.org.uk>
@ 1998-07-27 11:55   ` Aleksey Demakov <avd@gcom.ru>
  1998-07-27 13:28     ` Re: [INTERFACES] large objects Peter T Mount <peter@retep.org.uk>
  0 siblings, 1 reply; 13+ messages in thread

From: Aleksey Demakov @ 1998-07-27 11:55 UTC (permalink / raw)
  To: Peter T Mount <peter@retep.org.uk>; +Cc: pgsql-interfaces

Peter T Mount <peter@retep.org.uk> writes:

> 
> The object is stored using a table/index pair, and takes up more disk
> space than a single object.
> 

How much more? And what about performance?

In fact I don't need very large objects. 64k or even 32k will suffice.
Could such not-so-large objects be implemented more effectively? It would
be very nice to have a new postgres type for this. The 8k limit is very
restrictive. What do postgres gurus think?

Aleksey

-- 
Aleksey Demakov
avd@gcom.ru



^ permalink  raw  reply  [nested|flat] 13+ messages in thread

* Re: [INTERFACES] large objects
  1998-07-27 07:21 large objects Aleksey Demakov <avd@gcom.ru>
  1998-07-27 09:48 ` Re: [INTERFACES] large objects Peter T Mount <peter@retep.org.uk>
  1998-07-27 11:55   ` Re: [INTERFACES] large objects Aleksey Demakov <avd@gcom.ru>
@ 1998-07-27 13:28     ` Peter T Mount <peter@retep.org.uk>
  0 siblings, 0 replies; 13+ messages in thread

From: Peter T Mount @ 1998-07-27 13:28 UTC (permalink / raw)
  To: Aleksey Demakov <avd@gcom.ru>; +Cc: Peter T Mount <peter@maidast.demon.co.uk>; pgsql-interfaces

On 27 Jul 1998, Aleksey Demakov wrote:

> Peter T Mount <peter@retep.org.uk> writes:
> 
> > 
> > The object is stored using a table/index pair, and takes up more disk
> > space than a single object.
> > 
> 
> How much more? And what about performance?
> 
> In fact I don't need very large objects. 64k or even 32k will suffice.
> Could such not-so-large objects be implemented more effectively?

Anything larger than the page size (default is 8k, but can be larger) are
a large object. The internals do alow for multiple storage managers, so it
is possible to use other methods than the current "Inversion" scheme.

We did have a posibility of a different manager, but I've heared nothing
of it for some time now (pre 6.3 if memory serves)/

> It would be very nice to have a new postgres type for this. The 8k limit
> is very restrictive. What do postgres gurus think? 

Part of the solution for the BLOB orphaning problem that JDBC & ODBC have
requires a unique type 'lo' (required to differenciate between a generic
oid, and a large object while vacuuming).

However, for most cases, the existing lo interface is the only realistic
way of handling them.

-- 
Peter T Mount peter@retep.org.uk or petermount@earthling.net
Main Homepage: http://www.retep.org.uk
************ Someday I may rebuild this signature completely ;-) ************
Work Homepage: http://www.maidstone.gov.uk Work EMail: peter@maidstone.gov.uk




^ permalink  raw  reply  [nested|flat] 13+ messages in thread

* Large Objects
@ 1998-11-18 23:49 David Giffin <david@agent911.com>
  1998-11-19 15:05 ` Re: [INTERFACES] Large Objects Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 13+ messages in thread

From: David Giffin @ 1998-11-18 23:49 UTC (permalink / raw)
  To: pgsql-interfaces@hub.org


I'm working on a project with large objects. I'm getting this error:

    Can't call method "Pg::PQlo_creat" on unblessed reference 

Here is the code it is choking on..

    $conn = Pg::PQsetdb('', '', '', '', $$SD{'database'});
    $lobj_Id = $conn->Pg::PQlo_creat($mode);

Let me know if you have any ideas.

Thanks in advance,

David




^ permalink  raw  reply  [nested|flat] 13+ messages in thread

* Re: [INTERFACES] Large Objects
  1998-11-18 23:49 Large Objects David Giffin <david@agent911.com>
@ 1998-11-19 15:05 ` Tom Lane <tgl@sss.pgh.pa.us>
  1998-11-19 22:51   ` Large Objects David Giffin <david@agent911.com>
  0 siblings, 1 reply; 13+ messages in thread

From: Tom Lane @ 1998-11-19 15:05 UTC (permalink / raw)
  To: David Giffin <david@agent911.com>; +Cc: pgsql-interfaces@hub.org

David Giffin <david@agent911.com> writes:
> I'm working on a project with large objects. I'm getting this error:
>     Can't call method "Pg::PQlo_creat" on unblessed reference 
> Here is the code it is choking on..
>     $conn = Pg::PQsetdb('', '', '', '', $$SD{'database'});
>     $lobj_Id = $conn->Pg::PQlo_creat($mode);

Offhand, I think you want to write just
      $lobj_Id = $conn->PQlo_creat($mode);
At least, my experiments with perl Pg have not needed to qualify the
names of methods invoked on an already-created object...

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 13+ messages in thread

* Large Objects
  1998-11-18 23:49 Large Objects David Giffin <david@agent911.com>
  1998-11-19 15:05 ` Re: [INTERFACES] Large Objects Tom Lane <tgl@sss.pgh.pa.us>
@ 1998-11-19 22:51   ` David Giffin <david@agent911.com>
  0 siblings, 0 replies; 13+ messages in thread

From: David Giffin @ 1998-11-19 22:51 UTC (permalink / raw)
  To: pgsql-general@postgreSQL.org


I'm working on integrating Large Objects into a database. I'm courious
about a couple of different things. 1) Can you view large objects from the
psql interface? 2) Is there a way to reference the large object from a
standard query or do I have create a method of running a query then
opening the data from the large object? 3) Is there anyone the has already
has a working model of this in Perl?

Thanks,

David





^ permalink  raw  reply  [nested|flat] 13+ messages in thread

* large objects
@ 1999-06-30 18:39 Lauri Posti <lauri@peak.edu.ee>
  1999-06-30 22:18 ` Re: [INTERFACES] large objects Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 13+ messages in thread

From: Lauri Posti @ 1999-06-30 18:39 UTC (permalink / raw)
  To: pgsql-interfaces; +Cc: pgsql-general@postgresql.org

Hi!

I've been trying to get postgres LO interface to work with python.

I have been successful with  three configurations:
1) pgsql 6.4.2 & PyGreSQL 2.2 on Linux/x86
2) pgsql 6.5beta1 & PyGgeSQL 2.3 on Linux/x86
3) pgsql 6.5beta1 & PyGreSQL 2.3 on SPARC/Solaris 2.6

And failed with all other:
* 6.5beta2 ... 6.5 final on SPARC/Solaris 2.6 and Linux/x86 with PyGreSQL
2.3 & 2.4 in any combination.

* 6.4.2 on SPARC/Solaris 2.6 with PyGreSQL 2.2 .. 2.4 


What i rally need is to get something to work on SPARC/Solaris. The only
vesrion taht has worked is 6.5beta1 but I can't find it anywhere.

with 6.4.2 & PyGreSQL on Solaris (on x86 linus it is ok) the problem is
following:
$python
Python 1.5.2 (#5, Jun 30 1999, 20:15:59)  [GCC egcs-2.91.66 19990314
(egcs-1.1.2  on sunos5
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> from pg import *
>>> c=connect()
>>> o=c.locreate(INV_WRITE)
>>> o.open(INV_WRITE)
>>> o.oid
21089
>>> o.close()
>>> o2=c.locreate(INV_WRITE)
>>> o2.open(INV_WRITE)
>>> 
>>> o2.write("hello")
>>> o2.close()
Traceback (innermost last):
  File "<stdin>", line 1, in ?
IOError: error while closing large object fd.
>>> 
 

and 6.5 on both Solaris $ Linux the problem is folllowing:
[postgres@liha pgsql]$ python
Python 1.5.2 (#3, Jun 13 1999, 23:57:46)  [GCC egcs-2.91.66 19990314/Linux
(egcs- on linux2
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> from pg import *
>>> con=connect("testdb","",5432,"","","koll","koll") 
>>> lo=con.locreate(INV_WRITE)
>>> lo.oid
18593
>>> lo.open(INV_WRITE)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
IOError: can't open large object.
>>> 
and backend says:
ERROR:  lo_lseek: invalid large obj descriptor (0)


Any ideas?

Thanks in advance,
Lauri




^ permalink  raw  reply  [nested|flat] 13+ messages in thread

* Re: [INTERFACES] large objects
  1999-06-30 18:39 large objects Lauri Posti <lauri@peak.edu.ee>
@ 1999-06-30 22:18 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 13+ messages in thread

From: Tom Lane @ 1999-06-30 22:18 UTC (permalink / raw)
  To: Lauri Posti <lauri@peak.edu.ee>; +Cc: pgsql-interfaces; pgsql-general@postgreSQL.org

Lauri Posti <lauri@peak.edu.ee> writes:
> I've been trying to get postgres LO interface to work with python.

I think you need begin/end transaction around lo_open ... lo_close
sequence.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 13+ messages in thread

* Large Objects
@ 2003-05-28 12:08 Nisha Joseph <nishatreesa@hotmail.com>
  2003-05-28 13:33 ` Re: Large Objects Jeroen T. Vermeulen <jtv@xs4all.nl>
  0 siblings, 1 reply; 13+ messages in thread

From: Nisha Joseph @ 2003-05-28 12:08 UTC (permalink / raw)
  To: pgsql-odbc@postgresql.org; pgsql-interfaces

Hi,

My application ,written in VC++ requires to copy data in a Microsoft Access 
Database to
Postgres database,remotely. I have been using odbc Driver 7.02.005 with
Postgresql 7.3.2 .

I need to transfer photographs stored as OLEObjecttype in a
Microsoft Aceess 2000 database to the  Postgres database.Right now I am 
using bytea type for storing photographs in the Postgresql database.

I want to store the photographs as Large Objects in the Postgres database.

Can anyone please help me regarding this?Can  you provide with sample code 
for this?

Thanks in Advance

Nisha

_________________________________________________________________
Sign-up for a FREE BT Broadband connection today! 
http://www.msn.co.uk/specials/btbroadband




^ permalink  raw  reply  [nested|flat] 13+ messages in thread

* Re: Large Objects
  2003-05-28 12:08 Large Objects Nisha Joseph <nishatreesa@hotmail.com>
@ 2003-05-28 13:33 ` Jeroen T. Vermeulen <jtv@xs4all.nl>
  0 siblings, 0 replies; 13+ messages in thread

From: Jeroen T. Vermeulen @ 2003-05-28 13:33 UTC (permalink / raw)
  To: Nisha Joseph <nishatreesa@hotmail.com>; +Cc: pgsql-odbc@postgresql.org; pgsql-interfaces

On Wed, May 28, 2003 at 12:08:46PM +0000, Nisha Joseph wrote:
> 
> I want to store the photographs as Large Objects in the Postgres database.
> 
> Can anyone please help me regarding this?Can  you provide with sample code 
> for this?

Try libpqxx; the development versions have had large object support for
months now.  The only reason I haven't bumped that feature to stable yet
is that I don't have any test cases for mixed-mode access yet (ie.,
mixing read and write objects to the same large object).

It offers two interface levels for large objects: as standard C++ I/O
streams or as more C-style "write n bytes" or "write this std::string"
operations on handle objects.  Either should suit you, although you'd
want to be careful to disable whitespace skipping and such on I/O streams.

Find it at http://pqxx.tk/


Jeroen




^ permalink  raw  reply  [nested|flat] 13+ messages in thread

* Re: Large Objects
@ 2003-05-28 13:45 Christoph Haller <ch@rodos.fzk.de>
  0 siblings, 0 replies; 13+ messages in thread

From: Christoph Haller @ 2003-05-28 13:45 UTC (permalink / raw)
  To: pgsql-interfaces; nishatreesa@hotmail.com

>
> My application ,written in VC++ requires to copy data in a Microsoft
Access
> Database to
> Postgres database,remotely. I have been using odbc Driver 7.02.005
with
> Postgresql 7.3.2 .
>
> I need to transfer photographs stored as OLEObjecttype in a
> Microsoft Aceess 2000 database to the  Postgres database.Right now I
am
> using bytea type for storing photographs in the Postgresql database.
>
> I want to store the photographs as Large Objects in the Postgres
database.
>
> Can anyone please help me regarding this?Can  you provide with sample
code
> for this?
>
Nisha,
Did you already go to
http://techdocs.postgresql.org/guides/MSAccess
I'm not familiar with stuff like that, but to me it looks like
it's answering every question you might have.
Regards, Christoph





^ permalink  raw  reply  [nested|flat] 13+ messages in thread


end of thread, other threads:[~2003-05-28 13:45 UTC | newest]

Thread overview: 13+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1998-07-17 06:39 large objects dwalker@eskimo.com
1998-07-27 07:21 large objects Aleksey Demakov <avd@gcom.ru>
1998-07-27 09:48 ` Peter T Mount <peter@retep.org.uk>
1998-07-27 11:55   ` Aleksey Demakov <avd@gcom.ru>
1998-07-27 13:28     ` Peter T Mount <peter@retep.org.uk>
1998-11-18 23:49 Large Objects David Giffin <david@agent911.com>
1998-11-19 15:05 ` Re: [INTERFACES] Large Objects Tom Lane <tgl@sss.pgh.pa.us>
1998-11-19 22:51   ` Large Objects David Giffin <david@agent911.com>
1999-06-30 18:39 large objects Lauri Posti <lauri@peak.edu.ee>
1999-06-30 22:18 ` Tom Lane <tgl@sss.pgh.pa.us>
2003-05-28 12:08 Large Objects Nisha Joseph <nishatreesa@hotmail.com>
2003-05-28 13:33 ` Re: Large Objects Jeroen T. Vermeulen <jtv@xs4all.nl>
2003-05-28 13:45 Re: Large Objects Christoph Haller <ch@rodos.fzk.de>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox