PostgreSQL 7.1.3 Documentation
Prev |  | Next

# pkey

## Name

pkey -- returns the primary key of a table

## Synopsis

    pkey(table)

### Parameters

`table`

  name of table.

### Return Type

string

  Name of field which is the primary key of the table.

## Description

`pkey()` method returns the primary key of a table. Note that this raises an exception if the table does not have a primary key.

Prev | Home | Next
Database wrapper class: `DB` | Up | get_databases