> The problem is that this does not actually give me the number that
> was just created. As there is no guarantee that the other fields in
> the table are unique (hence the serial field in the first place) I cannot
> simply do a select to retrieve it.
Easiest answer is to do
SELECT nextval('sequence_object');
and then INSERT the new row into your table using the value you just
obtained as an explicit value for the ID column, thus overriding the
default expression.
regards, tom lane