Обсуждение: BLOB HOWTO??

Поиск
Список
Период
Сортировка

BLOB HOWTO??

От
Olivier PRENANT
Дата:
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)



Re: BLOB HOWTO??

От
Olivier PRENANT
Дата:
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)



Re: BLOB HOWTO??

От
"Martin A. Marques"
Дата:
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
-----------------------------------------------------------------


Re: BLOB HOWTO??

От
Bruce Momjian
Дата:
> 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,
Pennsylvania19026
 


Re: BLOB HOWTO??

От
Bruce Momjian
Дата:
> 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,
Pennsylvania19026
 


Re: BLOB HOWTO??

От
Olivier PRENANT
Дата:
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)



Re: BLOB HOWTO??

От
Bruce Momjian
Дата:
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,
Pennsylvania19026
 


Re: [SQL] Re: BLOB HOWTO??

От
Jan Wieck
Дата:
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



Re: BLOB HOWTO??

От
Jan Wieck
Дата:
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
updatedand 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
toasterfor   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



Re: BLOB HOWTO??

От
Jan Wieck
Дата:
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
mindis
 
   1.  You have to cleanup yourself - the existing large objects       aren't  removed  automatically  if you delete a
tablerow       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



Re: BLOB HOWTO??

От
Franck Martin
Дата:
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