You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that timestamp precision is completely unsupported. This would be a very important feature to support to ensure that the target database has timestamps in the same format and precision as the original database. For example, Mysql 5 has 0 precision timestamps.
Configuration
CAST
type timestamp
to timestamptz(0)
Error
KABOOM!
ESRAP-PARSE-ERROR: At
type timestamp
to timestamptz(0)
^
It's possible to work around, by first migrating with default precision and later manually altering each column:
ALTER TABLE tbl ALTER COLUMN ts TYPE timestamptz(0);
or as a loop:
do $$
declare
t record;
begin
for t IN select column_name, table_name
from information_schema.columns
where data_type = 'timestamp with time zone'
and table_schema = 'your_schema'
loop
execute 'alter table ' || t.table_name || ' alter column ' || t.column_name || ' type timestamptz(0)';
end loop;
end$$;
do $$
declare
t record;
begin
for t IN select column_name, table_name
from information_schema.columns
where data_type = 'timestamp without time zone'
and table_schema = 'your_schema'
loop
execute 'alter table ' || t.table_name || ' alter column ' || t.column_name || ' type timestamp(0)';
end loop;
end$$;
EDIT: This has been acknowledged as a missing feature #936 (comment) (back in 2019)
At the moment there's no support in pgloader for giving a typemod on the target data type, so that you. can't do that. So you have to migrate to text as done by default, and then see about using ALTER TABLE to get back to a varchar(2048), unless you want to add a CHECK constraint.
The text was updated successfully, but these errors were encountered:
It seems that timestamp precision is completely unsupported. This would be a very important feature to support to ensure that the target database has timestamps in the same format and precision as the original database. For example, Mysql 5 has 0 precision timestamps.
Configuration
Error
It's possible to work around, by first migrating with default precision and later manually altering each column:
or as a loop:
EDIT: This has been acknowledged as a missing feature #936 (comment) (back in 2019)
The text was updated successfully, but these errors were encountered: