I am inserting data into a table in postgres, it happens that I have a field that does not exist in the referenced table and then the error when trying to insert a record that does not exist. I need to put a where
...
INSERT INTO sexo(id,censo,sexo)
SELECT "SEXO","CENSO","ABREV"
FROM dblink('dbname=censos2001 host=localhost user=postgres password=admin' ::text,'SELECT "SEXO","CENSO","ABREV" FROM "SEXO"' ::text,false)
as tabela_temp("SEXO" varchar, "CENSO" varchar ,"ABREV" character varying)