I got this by accident:
db=> select name from site;
ERROR: column "name" does not exist
LINE 1: select name from site;
^
db=> select site.name from site;
name
---------------
(1,mysitename)
(1 row)
The second query return a tuple containing a whole row. Using postgres 9.0.1.
Edit: the definition of site by request. I doesn't really matter, this quirk works for any table.
db=> \d site
Table "public.site"
Column | Type | Modifiers
--------+---------+---------------------------------------------------
id | integer | not null default nextval('site_id_seq'::regclass)
title | text | not null
site
.site
to begin with. Why would you query for a column that doesn't exist?select site from site
- this will help you understand Gaius's answer in more detail