Here's a postgresql trick you might find handy.
First, from the command line, run psql with the -E switch like so:
psql -E dbnamehere
Then, enter
\d tablename
Postgresql will not show the queries used to retrieve the information by the \d command. The query that looks like this:
SELECT a.attname, format_type(a.atttypid, a.atttypmod), a.attnotnull, a.atthasdef, a.attnum
FROM pg_class c, pg_attribute a
WHERE c.relname = 'y'
AND a.attnum > 0 AND a.attrelid = c.oid
ORDER BY a.attnum
That one will show you how the fields of your table are put together.