pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BLOB HOWTO??
12+ messages / 6 participants
[nested] [flat]

* BLOB HOWTO??
@ 2001-01-28 19:59  Olivier PRENANT <ohp@pyrenet.fr>
  0 siblings, 2 replies; 12+ messages in thread

From: Olivier PRENANT @ 2001-01-28 19:59 UTC (permalink / raw)
  To: pgsql-hackers@postgresql.org.pgsql-sql

Hi,

Beeing very impressed by TOAST, I wonder how I can insert BLOB from a flat
file.

It seems quite easy with php; But how can I do it from psql??

TIA

-- 
Olivier PRENANT         	Tel:	+33-5-61-50-97-00 (Work)
Quartier d'Harraud Turrou           +33-5-61-50-97-01 (Fax)
31190 AUTERIVE                      +33-6-07-63-80-64 (GSM)
FRANCE                      Email: ohp@pyrenet.fr
------------------------------------------------------------------------------
Make your life a dream, make your dream a reality. (St Exupery)




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

* Re: BLOB HOWTO??
@ 2001-01-29 11:17  Olivier PRENANT <ohp@pyrenet.fr>
  0 siblings, 3 replies; 12+ messages in thread

From: Olivier PRENANT @ 2001-01-29 11:17 UTC (permalink / raw)
  To: Bruce Momjian <pgman@candle.pha.pa.us>; +Cc: pgsql-hackers@postgresql.org; pgsql-sql

Hi Bruce,

Any idea when it's due for??
I've been thining about writing a user function; But I'll get stuck with
permission as a user function is running under the "postgres" or whatever
user instead of the calling user.

Also, what kind of binary interface are you thinking of??

Regards,
 On Sun, 28 Jan 2001, Bruce Momjian wrote:

> No way.  We haven't written a binary interface to TOAST yet.
> 
> > Hi,
> > 
> > Beeing very impressed by TOAST, I wonder how I can insert BLOB from a flat
> > file.
> > 
> > It seems quite easy with php; But how can I do it from psql??
> > 
> > TIA
> > 
> > -- 
> > Olivier PRENANT         	Tel:	+33-5-61-50-97-00 (Work)
> > Quartier d'Harraud Turrou           +33-5-61-50-97-01 (Fax)
> > 31190 AUTERIVE                      +33-6-07-63-80-64 (GSM)
> > FRANCE                      Email: ohp@pyrenet.fr
> > ------------------------------------------------------------------------------
> > Make your life a dream, make your dream a reality. (St Exupery)
> > 
> > 
> 
> 
> 

-- 
Olivier PRENANT         	Tel:	+33-5-61-50-97-00 (Work)
Quartier d'Harraud Turrou           +33-5-61-50-97-01 (Fax)
31190 AUTERIVE                      +33-6-07-63-80-64 (GSM)
FRANCE                      Email: ohp@pyrenet.fr
------------------------------------------------------------------------------
Make your life a dream, make your dream a reality. (St Exupery)




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

* Re: BLOB HOWTO??
@ 2001-01-29 12:49  Martin A. Marques <martin@math.unl.edu.ar>
  parent: Olivier PRENANT <ohp@pyrenet.fr>
  1 sibling, 0 replies; 12+ messages in thread

From: Martin A. Marques @ 2001-01-29 12:49 UTC (permalink / raw)
  To: Olivier PRENANT <ohp@pyrenet.fr>; pgsql-hackers@postgresql.org

El Dom 28 Ene 2001 16:59, Olivier PRENANT escribió:
>
> Beeing very impressed by TOAST, I wonder how I can insert BLOB from a flat
> file.
>
> It seems quite easy with php; But how can I do it from psql??

I think you mean that it seems easy, because I haven't been able to 
understand it (always talking about the php way).

I can't understand how the pg module of php knows where the large object 
should be inserted. I mean, what if I have 2 large objects in the same 
database (or even in the same table), where is the data inserted? There is no 
place where someone tells php that the data in this variable should go in 
this column that is of type blob.

TIA

-- 
System Administration: It's a dirty job, 
but someone told I had to do it.
-----------------------------------------------------------------
Martín Marqués			email: 	martin@math.unl.edu.ar
Santa Fe - Argentina		http://math.unl.edu.ar/~martin/
Administrador de sistemas en math.unl.edu.ar
-----------------------------------------------------------------



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

* Re: BLOB HOWTO??
@ 2001-01-29 16:19  robert gravsjo <robert.gravsjo@nsgroup.net>
  parent: Olivier PRENANT <ohp@pyrenet.fr>
  1 sibling, 0 replies; 12+ messages in thread

From: robert gravsjo @ 2001-01-29 16:19 UTC (permalink / raw)
  To: pgsql-sql

Maybe the functions lo_import and lo_export is what you're looking for?

regards,
robert gravsjo

Olivier PRENANT wrote:

> Hi,
> 
> Beeing very impressed by TOAST, I wonder how I can insert BLOB from a flat
> file.
> 
> It seems quite easy with php; But how can I do it from psql??
> 
> TIA
> 





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

* Re: BLOB HOWTO??
@ 2001-01-29 16:36  Bruce Momjian <pgman@candle.pha.pa.us>
  parent: Olivier PRENANT <ohp@pyrenet.fr>
  2 siblings, 1 reply; 12+ messages in thread

From: Bruce Momjian @ 2001-01-29 16:36 UTC (permalink / raw)
  To: ohp@pyrenet.fr; +Cc: pgsql-hackers@postgresql.org; pgsql-sql

> Hi Bruce,
> 
> Any idea when it's due for??
> I've been thining about writing a user function; But I'll get stuck with
> permission as a user function is running under the "postgres" or whatever
> user instead of the calling user.
> 
> Also, what kind of binary interface are you thinking of??

Lack of large object support for new TOAST columns is going to be a big
7.1 complaint.  I was thinking of using the same functions as our large
object stuff, but remove the OID requirement.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026



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

* Re: BLOB HOWTO??
@ 2001-01-29 16:37  Bruce Momjian <pgman@candle.pha.pa.us>
  parent: Olivier PRENANT <ohp@pyrenet.fr>
  2 siblings, 1 reply; 12+ messages in thread

From: Bruce Momjian @ 2001-01-29 16:37 UTC (permalink / raw)
  To: ohp@pyrenet.fr; +Cc: pgsql-hackers@postgresql.org; pgsql-sql

> Hi Bruce,
> 
> Any idea when it's due for??

When?  Probably not until 7.2, which is a pain.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026



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

* Re: BLOB HOWTO??
@ 2001-01-29 17:32  Olivier PRENANT <ohp@pyrenet.fr>
  parent: Bruce Momjian <pgman@candle.pha.pa.us>
  0 siblings, 1 reply; 12+ messages in thread

From: Olivier PRENANT @ 2001-01-29 17:32 UTC (permalink / raw)
  To: Bruce Momjian <pgman@candle.pha.pa.us>; +Cc: pgsql-hackers@postgresql.org; pgsql-sql

Bruce,

Thanks for replying (I know you're a busy man :)

Any chance to have it backported to 7.1 or maybe in contrib???

This is a feature w all gonna lack (with GiST...)

Regards,
On Mon, 29 Jan 2001, Bruce Momjian wrote:

> > Hi Bruce,
> > 
> > Any idea when it's due for??
> > I've been thining about writing a user function; But I'll get stuck with
> > permission as a user function is running under the "postgres" or whatever
> > user instead of the calling user.
> > 
> > Also, what kind of binary interface are you thinking of??
> 
> Lack of large object support for new TOAST columns is going to be a big
> 7.1 complaint.  I was thinking of using the same functions as our large
> object stuff, but remove the OID requirement.
> 
> 

-- 
Olivier PRENANT         	Tel:	+33-5-61-50-97-00 (Work)
Quartier d'Harraud Turrou           +33-5-61-50-97-01 (Fax)
31190 AUTERIVE                      +33-6-07-63-80-64 (GSM)
FRANCE                      Email: ohp@pyrenet.fr
------------------------------------------------------------------------------
Make your life a dream, make your dream a reality. (St Exupery)




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

* Re: BLOB HOWTO??
@ 2001-01-29 17:42  Bruce Momjian <pgman@candle.pha.pa.us>
  parent: Olivier PRENANT <ohp@pyrenet.fr>
  0 siblings, 1 reply; 12+ messages in thread

From: Bruce Momjian @ 2001-01-29 17:42 UTC (permalink / raw)
  To: ohp@pyrenet.fr; +Cc: pgsql-hackers@postgresql.org; pgsql-sql


I would LOVE to see it in a minor 7.1.X release.


> Bruce,
> 
> Thanks for replying (I know you're a busy man :)
> 
> Any chance to have it backported to 7.1 or maybe in contrib???
> 
> This is a feature w all gonna lack (with GiST...)

> 
> Regards,
> On Mon, 29 Jan 2001, Bruce Momjian wrote:
> 
> > > Hi Bruce,
> > > 
> > > Any idea when it's due for??
> > > I've been thining about writing a user function; But I'll get stuck with
> > > permission as a user function is running under the "postgres" or whatever
> > > user instead of the calling user.
> > > 
> > > Also, what kind of binary interface are you thinking of??
> > 
> > Lack of large object support for new TOAST columns is going to be a big
> > 7.1 complaint.  I was thinking of using the same functions as our large
> > object stuff, but remove the OID requirement.
> > 
> > 
> 
> -- 
> Olivier PRENANT         	Tel:	+33-5-61-50-97-00 (Work)
> Quartier d'Harraud Turrou           +33-5-61-50-97-01 (Fax)
> 31190 AUTERIVE                      +33-6-07-63-80-64 (GSM)
> FRANCE                      Email: ohp@pyrenet.fr
> ------------------------------------------------------------------------------
> Make your life a dream, make your dream a reality. (St Exupery)
> 
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026



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

* Re: BLOB HOWTO??
@ 2001-01-29 18:10  Jan Wieck <janwieck@Yahoo.com>
  parent: Bruce Momjian <pgman@candle.pha.pa.us>
  0 siblings, 0 replies; 12+ messages in thread

From: Jan Wieck @ 2001-01-29 18:10 UTC (permalink / raw)
  To: Bruce Momjian <pgman@candle.pha.pa.us>; +Cc: ohp@pyrenet.fr; pgsql-hackers@postgresql.org; pgsql-sql

Bruce Momjian wrote:
> > Hi Bruce,
> >
> > Any idea when it's due for??
>
> When?  Probably not until 7.2, which is a pain.

    We cannot use TOAST as is for BLOB/CLOB storage with a binary
    IO interface over fastpath.

    The reason is that you cannot force a column to be moved  off
    anyway  and  that  the  toast reference contains the original
    objects size.  Thus, opening a BLOB for writing would require
    the  reference  in  the  main  tuple to get updated and maybe
    moving off the data first.

    My plans for 7.2 are to use the toast table for storage,  but
    to build new data types with support hooks in the toaster for
    it.


Jan

--

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



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




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

* Re: [SQL] Re: BLOB HOWTO??
@ 2001-01-29 18:12  Jan Wieck <janwieck@Yahoo.com>
  parent: Bruce Momjian <pgman@candle.pha.pa.us>
  0 siblings, 0 replies; 12+ messages in thread

From: Jan Wieck @ 2001-01-29 18:12 UTC (permalink / raw)
  To: Bruce Momjian <pgman@candle.pha.pa.us>; +Cc: ohp@pyrenet.fr; pgsql-hackers@postgresql.org; pgsql-sql

Bruce Momjian wrote:
>
> I would LOVE to see it in a minor 7.1.X release.

    It's   *feature*   with   alot   necessary   coding  in  core
    functionality below heap access methods. Not a good candidate
    for a bugfix release.


Jan

>
>
> > Bruce,
> >
> > Thanks for replying (I know you're a busy man :)
> >
> > Any chance to have it backported to 7.1 or maybe in contrib???
> >
> > This is a feature w all gonna lack (with GiST...)
>
> >
> > Regards,
> > On Mon, 29 Jan 2001, Bruce Momjian wrote:
> >
> > > > Hi Bruce,
> > > >
> > > > Any idea when it's due for??
> > > > I've been thining about writing a user function; But I'll get stuck with
> > > > permission as a user function is running under the "postgres" or whatever
> > > > user instead of the calling user.
> > > >
> > > > Also, what kind of binary interface are you thinking of??
> > >
> > > Lack of large object support for new TOAST columns is going to be a big
> > > 7.1 complaint.  I was thinking of using the same functions as our large
> > > object stuff, but remove the OID requirement.
> > >
> > >
> >
> > --
> > Olivier PRENANT           Tel: +33-5-61-50-97-00 (Work)
> > Quartier d'Harraud Turrou           +33-5-61-50-97-01 (Fax)
> > 31190 AUTERIVE                      +33-6-07-63-80-64 (GSM)
> > FRANCE                      Email: ohp@pyrenet.fr
> > ------------------------------------------------------------------------------
> > Make your life a dream, make your dream a reality. (St Exupery)
> >
> >
>
> --
>   Bruce Momjian                        |  http://candle.pha.pa.us
>   pgman@candle.pha.pa.us               |  (610) 853-3000
>   +  If your life is a hard drive,     |  830 Blythe Avenue
>   +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
>


--

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



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




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

* Re: BLOB HOWTO??
@ 2001-01-29 19:14  Jan Wieck <janwieck@Yahoo.com>
  parent: Olivier PRENANT <ohp@pyrenet.fr>
  2 siblings, 1 reply; 12+ messages in thread

From: Jan Wieck @ 2001-01-29 19:14 UTC (permalink / raw)
  To: ohp@pyrenet.fr; +Cc: Bruce Momjian <pgman@candle.pha.pa.us>; pgsql-hackers@postgresql.org; pgsql-sql

Olivier PRENANT wrote:
> Hi Bruce,
>
> Any idea when it's due for??
> I've been thining about writing a user function; But I'll get stuck with
> permission as a user function is running under the "postgres" or whatever
> user instead of the calling user.
>
> Also, what kind of binary interface are you thinking of??

    Something similar to the existing lo_...() functions.

    Actually,  someone  should  use the existing large objects to
    deal with binary content.  What has to be kept in mind is

    1.  You have to cleanup yourself - the existing large objects
        aren't  removed  automatically  if you delete a table row
        referencing to the LO or drop the table.

    2.  The existing LOs don't have copy  behaviour.  So  if  you
        reference  to  a  LO  from one table and do an INSERT ...
        SELECT, just it's OID is copied,  not  the  data  (as  it
        should be IMHO).


Jan

--

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



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




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

* Re: BLOB HOWTO??
@ 2001-01-30 09:50  Franck Martin <franck@sopac.org>
  parent: Jan Wieck <janwieck@Yahoo.com>
  0 siblings, 0 replies; 12+ messages in thread

From: Franck Martin @ 2001-01-30 09:50 UTC (permalink / raw)
  To: Jan Wieck <janwieck@Yahoo.com>; +Cc: ohp@pyrenet.fr, Bruce Momjian <pgman@candle.pha.pa.us>; pgsql-hackers@postgresql.org; pgsql-sql

I'm interested by TOAST, and I have asked several questions on the subject...
I haven't tested them yet...

First I thought that the type bytea allows storing of binary data, a BSOB
(Binary Small OBject).
Secondly that by using a binary cursor you have access to the raw data as it
is stored in the database, but not as it is presented in ASCII
Thridly we could use a funtion to retreive parts of columns, something like
mid(column,start,length)
Fourthly we may use the same function for storing data back.

Cheers...
Franck@sopac.org

Jan Wieck wrote:

> Olivier PRENANT wrote:
> > Hi Bruce,
> >
> > Any idea when it's due for??
> > I've been thining about writing a user function; But I'll get stuck with
> > permission as a user function is running under the "postgres" or whatever
> > user instead of the calling user.
> >
> > Also, what kind of binary interface are you thinking of??
>
>     Something similar to the existing lo_...() functions.
>
>     Actually,  someone  should  use the existing large objects to
>     deal with binary content.  What has to be kept in mind is
>
>     1.  You have to cleanup yourself - the existing large objects
>         aren't  removed  automatically  if you delete a table row
>         referencing to the LO or drop the table.
>
>     2.  The existing LOs don't have copy  behaviour.  So  if  you
>         reference  to  a  LO  from one table and do an INSERT ...
>         SELECT, just it's OID is copied,  not  the  data  (as  it
>         should be IMHO).
>
> Jan
>
> --
>
> #======================================================================#
> # It's easier to get forgiveness for being wrong than for being right. #
> # Let's break this rule - forgive me.                                  #
> #================================================== JanWieck@Yahoo.com #
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com




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


end of thread, other threads:[~2001-01-30 09:50 UTC | newest]

Thread overview: 12+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-01-28 19:59 BLOB HOWTO?? Olivier PRENANT <ohp@pyrenet.fr>
2001-01-29 12:49 ` Martin A. Marques <martin@math.unl.edu.ar>
2001-01-29 16:19 ` robert gravsjo <robert.gravsjo@nsgroup.net>
2001-01-29 11:17 Re: BLOB HOWTO?? Olivier PRENANT <ohp@pyrenet.fr>
2001-01-29 16:36 ` Bruce Momjian <pgman@candle.pha.pa.us>
2001-01-29 17:32   ` Olivier PRENANT <ohp@pyrenet.fr>
2001-01-29 17:42     ` Bruce Momjian <pgman@candle.pha.pa.us>
2001-01-29 18:12       ` Jan Wieck <janwieck@Yahoo.com>
2001-01-29 16:37 ` Bruce Momjian <pgman@candle.pha.pa.us>
2001-01-29 18:10   ` Jan Wieck <janwieck@Yahoo.com>
2001-01-29 19:14 ` Jan Wieck <janwieck@Yahoo.com>
2001-01-30 09:50   ` Franck Martin <franck@sopac.org>

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