Ramiro Alba <ramiro(at)labtie(dot)mmt(dot)upc(dot)es> writes:
> I would need to create an exact reproduction of a certain table
> (excluding data) converving primary key attributes and so on.
Try
pg_dump -s -t tablename dbname | psql dbname
There is no easy way to do this directly in SQL ...
regards, tom lane