On this page

SHOW PK

Core command SHOW PRIMARY KEYS SH PK SHPK

Shows the primary key columns of a table.

Syntax

SHOW PK [<schema>.]<table>

Arguments

ArgumentRequiredValuesDefault
<table>YesThe exact table name, in any caseNone
<schema>.NoThe schema of the table, followed by a dotThe current schema

Examples

SHOW PK CUSTOMER;
SHOW PK PUBLIC.CUSTOMER;

Details

The table is found exactly as for DESCR: in the given schema or the current one, tried as typed, then in upper case, then in lower case, and otherwise matched exactly (_ and % are ordinary characters of the name, never wildcards).

A table without a primary key is reported as such. The command fails when no table name is given, when the table does not exist or is ambiguous, or when the JDBC driver cannot provide primary key metadata.

Used in these how-tos

Last modified in release 5.5.0.

Found something wrong or unclear on this page? , with the page address.