I\'m new at postgres (and at database info systems all in all). I ran following sql script on my database:
create table cities (
id serial primary key,
name
Since PostgreSQL 8.2 you have to use:
GRANT USAGE, SELECT ON SEQUENCE cities_id_seq TO www;
GRANT USAGE - For sequences, this privilege allows the use of the currval and nextval functions.
Also as pointed out by @epic_fil in the comments you can grant permissions to all the sequences in the schema with:
GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA public TO www;