Re: binary data storage

Поиск
Список
Период
Сортировка
От Doug McNaught
Тема Re: binary data storage
Дата
Msg-id m38z81znwy.fsf@varsoon.wireboard.com
обсуждение исходный текст
Ответ на Re: binary data storage  (Devrim GUNDUZ <devrim@oper.metu.edu.tr>)
Список pgsql-general
Martín Marqués <martin@bugs.unl.edu.ar> writes:

> Now, I want to do an insert of a row, in which I add data to all the columns
> except the oid column, in which I want to insert a file. How do I make the
> insert with PHP, in a way that the info of row and the file loaded
> in the oid column are really in the same row.

OK, here's pseudocode.  Assuming PHP has a an interface to the lo_
routines, you'd do something like this:

BEGIN WORK;
$file_oid = lo_import("myfile");
INSERT INTO mytable(field1, field2, file_oid) VALUES ('foo', 'bar', $file_oid);
COMMIT WORK;

Does this help?

-Doug
--
Doug McNaught       Wireboard Industries      http://www.wireboard.com/

      Custom software development, systems and network consulting.
      Java PostgreSQL Enhydra Python Zope Perl Apache Linux BSD...

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Row locking inside a rule, is it possible?
Следующее
От: Ed Loehr
Дата:
Сообщение: 7.1.2 clients + 7.2.1 server?