This page in other versions: Unsupported versions: 7.1 / 7.2 / 7.3



get -- get a tuple from a database table


get(table, arg, [keyname])



Name of table.


Either a dictionary or the value to be looked up.


Name of field to use as key (optional).

Return Type


A dictionary mapping attribute names to row values.


This method is the basic mechanism to get a single row. It assumes that the key specifies a unique row. If keyname is not specified then the primary key for the table is used. If arg is a dictionary then the value for the key is taken from it and it is modified to include the new values, replacing existing values where necessary. The OID is also put into the dictionary but in order to allow the caller to work with multiple tables, the attribute name is munged to make it unique. It consists of the string oid_ followed by the name of the table.

Submit correction

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group