Search Postgresql Archives

Re: Selecting Large Object and TOAST

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



So are you suggesting, I need to send the Large object ID to the client?
Since the application is time critical, is there a way to skip one of the two steps (querying once for LOID and then again for its data) to a one step by sending the Object data in the first call?

Are there any examples or pseudocode someone who's implemented using largeobjects to retrieve images to be shown as icons/images in web pages (using Stored procedures).

http://www.postgresql.org/docs/8.1/interactive/lo-examplesect.html
Is the above site's ExportFile() something that can help me (but it creates a file, different from what i want)?

As far as the size is concerned, i am testing with image resource, but we plan to store video clips too. Though we are planning to store thumbnails in Large Objects too.

>>     lo_get(oid) returns bytea
>>     lo_set(oid, bytea) returns void
>>     lo_ins(bytea) returns oid
>>     lo_del(oid) returns void
How do you suggest i create lo_get(oid) function returning bytea data.

thanks,
vish


On 12/5/05, vishal saberwal <vishalsaberwal@xxxxxxxxx > wrote:
thanks for all your responses,
really appreciate it,

I am sorry but I am not as familiar with this as much as you are.

So are you suggesting, I need to send the Large object ID to the client?
Since the application is time critical, is there a way to skip one of the two steps (querying once for LOID and then again for its data) to a one step by sending the Object data in the first call?

Are there any examples or pseudocode someone who's implemented using largeobjects to retrieve images to be shown as icons/images in web pages (using Stored procedures).

http://www.postgresql.org/docs/8.1/interactive/lo-examplesect.html
Is the above site's ExportFile() something that can help me (but it creates a file, different from what i want)?

As far as the size is concerned, i am testing with image resource, but we plan to store video clips too. Though we are planning to store thumbnails in Large Objects too.

>>     lo_get(oid) returns bytea
>>     lo_set(oid, bytea) returns void
>>     lo_ins(bytea) returns oid
>>     lo_del(oid) returns void
How do you suggest i create lo_get(oid) function returning bytea data.

I have understood that TOAST is internal implementation, thanks for the info.

thanks,
vish


On 12/4/05, Jan Wieck <JanWieck@xxxxxxxxx > wrote:
On 12/4/2005 11:45 PM, Joshua D. Drake wrote:

> Well as I said it depends on the size of the data. Are we talking 100
> meg vector images? Then large objects. Are we talking thumbnails that
> are 32k then bytea.

I'd say that anything up to a megabyte or so can easily live in bytea.
Beyond that it depends on the access pattern.

That said, for certain situations I think some sql-callable functions
would be very handy:

     lo_get(oid) returns bytea
     lo_set(oid, bytea) returns void
     lo_ins(bytea) returns oid
     lo_del(oid) returns void

Those (and maybe some more) would allow access of traditional large
objects through client interfaces that don't support the regular large
object calls.


Jan

--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@xxxxxxxxx #



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux