in sql server I do like this:
insert into foo(name) values(\'bob\')
select @@identity;
so I get a query/scalar result displayed
how to
Get a specific sequence:
SELECT currval('name_of_your_sequence');
Get the last value from the last sequence used:
SELECT lastval();
Check the manual as well: http://www.postgresql.org/docs/current/static/functions-sequence.html
Edit: You could also use RETURNING in your INSERT:
INSERT INTO foo(id, name) VALUES(DEFAULT, 'bob') RETURNING id;