Copying an entire table with Postgres
Posted
by NudeCanalTroll
on Stack Overflow
See other posts from Stack Overflow
or by NudeCanalTroll
Published on 2010-05-05T12:04:22Z
Indexed on
2010/05/05
12:08 UTC
Read the original article
Hit count: 220
Hello,
I'm trying to copy the contents of one table into another in Postgres, however it appears some rows aren't being copied correctly:
ActiveRecord::StatementInvalid: PGError: ERROR: column "email_date" is of type timestamp without time zone but expression is of type character varying HINT: You will need to rewrite or cast the expression.
Is there any way I can have it automatically skip (or ignore) invalid rows?
Here's the query I'm using:
SET statement_timeout = 0; INSERT INTO emails3 SELECT * FROM emails
© Stack Overflow or respective owner