Database Reference
In-Depth Information
Suppose we need a table that can store digital pictures of huge sizes.
We will irst create a table named test_large_objects . This can be done in the
following manner:
postgres=# CREATE TABLE test_large_objects
(
picture_id INTEGER,
name VARCHAR(30),
picture_loc oid,
CONSTRAINT pk_picture_id PRIMARY KEY(picture_id)
);
We have an image residing in our local storage on a directory, say the /tmp/
directory, named as pg_disney.jpg .
User should have permissions to read the ile.
Of course, we have not inserted a row with an image yet. Let's still query the pg_
largeobject system table and the test_large_objects table for their current state.
When we insert a row that includes a function call, it will affect the system table as
well. Let's check the pg_largeobject system table using the following statement:
postgres=# SELECT * FROM pg_largeobject;
loid | pageno | data
------+--------+------
(0 rows)
Let's check the test_large_object table using the following statement:
postgres=# SELECT * FROM test_large_objects;
picture_id | name | picture_loc
------------+------+-------------
(0 rows)
 
Search WWH ::




Custom Search