Countable
, ITeratorAggregateThe primary key of a table.
The following query is executed by the current executor of the table to retrieve the primary key columns:
select
a.attname as column
from pg_class c
join pg_index i on c.oid = i.indrelid
join pg_attribute a on c.oid = a.attrelid
where
c.relname = \$1
and a.attnum = any(i.indkey)
and i.indisprimary
order by
a.attnum
The result of this query is cached in the metadata cache under the following key, where $table is converted to a string
by pq\Gateway\Table::__toString():
"$table:identity"
Lookup the primary key of a table.
void
pq\Gateway\Table\Identity::__construct(pq\Gateway\Table $table)
Implements Countable
.
Retrieve the columns of the table identity.
Implements IteratorAggregate
.