That's not an associative array, it's just an array of a composite type. The hstore type is probably the closest you'd get to an associate array in PostgreSQL, but the keys and values are always strings.
That's not an associative array, it's just an array of a composite type. The hstore type is probably the closest you'd get to an associate array in PostgreSQL, but the keys and values are always strings.
No, a table (possibly a temp table with the results of a particular query) with an appropriately defined primary key (or other unique index) would be the closest you can get to an associative array -- since a relation with n candidate keys is exactly identical to n different associative arrays with the same data but different key/value splits.
But an array of a composite type drawn in such a way that some set of columns is guaranteed unique is pretty much the same thing from a data perspective, even though you may need to do work on the client side to load it into a structure that supports associative array operations (e.g., efficient key/value lookups).
The "associative" in associative array implies association is a property of the data structure, not the way you happen to be using it.
CREATE OR REPLACE FUNCTION get_people()
RETURNS person[] LANGUAGE sql AS
person is a composite type, defined further up. The square brackets indicate an array of that type.