ГЛАВНАЯ  |  НОВОСТИ  |  О НАС  |  ДОКУМЕНТАЦИЯ  |  СЛОВАРЬ  |  КОНТАКТЫ  
 

 
W3C
Спецификация HTML 4.01 (на русском)
HTML 4.0 Entities
Спецификация CSS2 (на русском)
Расширяемый Язык Разметки (XML) 1.0 (на русском)
Расширяемый Язык Стилей (XSL) 1.0 (на русском)
Расширяемый Язык Гипертекстовой Разметки (XHTML) 1.0 (на русском)
XHTML 1.1 - XHTML на базе модулей (на русском)
Модуляризация XHTML (на русском)
Mason
Документация по Mason (на русском)
Mason Documentation (english)
Embedding Perl in HTML with Mason (english)
Поисковые машины
mnoGoSearch 3.2.15 (на русском)
mnoGoSearch 3.3.7 (english)
RDBMS
PostgreSQL 8.4 Documentation (english)
FreeBSD & UNIX
Manpage Viewer / Страницы помощи (english)
Руководство FreeBSD (на русском)
FreeBSD Handbook (english)
Часто задаваемые вопросы по FreeBSD (на русском)
Frequently Asked Questions for FreeBSD (english)
Статьи о FreeBSD на русском
Другие руководства по FreeBSD (на русском)
Операционная система UNIX (на русском)
Протоколы сетевого взаимодействия TCP/IP (на русском)
VIDEO
MPlayer (mencoder) (на русском)
MPlayer (mencoder) (english)
FFMPEG (english)
GRAPHICS
User manual for Netpbm (english)
O'Reilly
O'Reilly's bookshelves (english)
 

31.4. Server-Side Functions

There are server-side functions callable from SQL that correspond to each of the client-side functions described above; indeed, for the most part the client-side functions are simply interfaces to the equivalent server-side functions. The ones that are actually useful to call via SQL commands are lo_creat, lo_create, lo_unlink, lo_import, and lo_export. Here are examples of their use:

CREATE TABLE image (
    name            text,
    raster          oid
);

SELECT lo_creat(-1);       -- returns OID of new, empty large object

SELECT lo_create(43213);   -- attempts to create large object with OID 43213

SELECT lo_unlink(173454);  -- deletes large object with OID 173454

INSERT INTO image (name, raster)
    VALUES ('beautiful image', lo_import('/etc/motd'));

INSERT INTO image (name, raster)  -- same as above, but specify OID to use
    VALUES ('beautiful image', lo_import('/etc/motd', 68583));

SELECT lo_export(image.raster, '/tmp/motd') FROM image
    WHERE name = 'beautiful image';

The server-side lo_import and lo_export functions behave considerably differently from their client-side analogs. These two functions read and write files in the server's file system, using the permissions of the database's owning user. Therefore, their use is restricted to superusers. In contrast, the client-side import and export functions read and write files in the client's file system, using the permissions of the client program. The client-side functions can be used by any PostgreSQL user.

 
 
 


 Copyright © DHS Group, 2000-2007.

 
 
E-mail: info@dhs.net.ru 
Тел.: +7 3952 664321