October 2001
Beginner to intermediate
400 pages
7h 45m
English
One of the nice features that PostgreSQL supports is the concept of fields that can hold arrays. This enables multiple values of the same data type to be stored in a single field.
To insert arrays into a field, the field should be marked as holding arrays during table creation. After a field has been designated to hold arrays, data can be inserted, selected, or updated into the array by referring to the specific array element in the designated table.
For example, let’s create a table named students that has a four-element array field to hold test scores:
CREATE TABLE students
(name char(20), testscore int[4]); Notice that, at table creation time, a field is designated as being able to support arrays by including ...
Read now
Unlock full access