Postgres pg_dump now stored procedure fails because of boolean
I have a stored procedure that has started to fail for no reason. Well
there must be one but I can't find it!
This is the process I have followed a number of times before with no problem.
The source server works fine!
I am doing a pg_dump of the database on source server and imported it onto
another server - This is fine I can see all the data and do updates.
Then I run a stored procedure on the imported database that does the
following on the database which has 2 identical schema's - For each table
in schema1 Truncate table in schema2 INSERT INTO schema2."table" SELECT *
FROM schema1."table" WHERE "Status" in ('A','N'); Next
However this gives me an error now when it did not before - The error is
*** Error ***
ERROR: column "HBA" is of type boolean but expression is of type integer
SQL state: 42804 Hint: You will need to rewrite or cast the expression.
Why am I getting this - The only difference between the last time I
followed this procedure and this time is that the table in question now
has an extra column added to it so the "HBA" boolean column is not the
last field. But then why would it work in original database!
I have tried removing all data, dropping and rebuilding table these all
fail. However if I drop column and adding it back in if works - Is there
something about Boolean fields that mean they need to be the last field!
Any help greatly apprieciated.
Using Postgres 9.1
No comments:
Post a Comment