Re: psql and blob

Поиск
Список
Период
Сортировка
От Daniel Schuchardt
Тема Re: psql and blob
Дата
Msg-id 1063896197.731.31.camel@ds-debian
обсуждение исходный текст
Ответ на Re: psql and blob  (Doug McNaught <doug@mcnaught.org>)
Ответы Re: psql and blob  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Yes thats it.

Ok - one last question.
My Script looks like this and actually i can run it only on the server (so i have to copy all my data to the server
eachtime i want to update my blobs): 

 INSERT INTO tablexy (BLOBFIELD) VALUES (lo_import('BLOBFILE')).

Now we know if I want to upload a clientfile I have to use \lo_import BUT i cant use this inside the script.

 INSERT INTO  tablexy (BLOBFIELD) VALUES (\lo_import('BLOBFILE')). is not possible because \lo_import is a unknown
commandfor the server. 

So I have to do 2 steps manually in psql:

 \lo_import(ClientFile) -> Returns OID

 INSERT INTO tablexy (BLOBFIELD) VALUES (Returned OID)

Is there a way to do this automatically?
Means my Clientside script should upload a local file (from the same computer where the script is executed) to the
serverand insert this file in a special table automatically. 

Thanks


Am Mi, 2003-09-17 um 22.42 schrieb Doug McNaught:
> Daniel Schuchardt <daniel_schuchardt@web.de> writes:
>
> > Hi @ all,
> >
> > i'm sure there was a psql-function to transfere my Blob-Data to the
> > server but I can't remember.
>
> The psql function to use is \lo_import--this reads the file from the
> client side.
>
> -Doug
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings


В списке pgsql-general по дате отправления:

Предыдущее
От: Daniel Schuchardt
Дата:
Сообщение: Re: psql and blob
Следующее
От: Gaetano Mendola
Дата:
Сообщение: Re: High-volume shop uses PostgreSQL