Serial not auto-incrementing when insert table into another table
You can't use the values
clause when the source is a SELECT
statement. And you can't use the DEFAULT
clause inside a SELECT. So the solution is to not specify the column that is auto-generated:
INSERT INTO station (code_hta, geom_hta)
SELECT code_gto, geom
FROM postes