Re:A Simple Guide to Five Normal Forms in Relational Databas...
by yangyang on Monday September 29, 2014 @01:19PM
(#8383853)
I meant as a self-contained type. PostgreSQL doesn't support nested tables.
The "associative" in associative array implies association is a property of the data structure, not the way you happen to be using it.
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).