pgloader icon indicating copy to clipboard operation
pgloader copied to clipboard

TYPE-ERROR: The value NIL is not of type PGLOADER.CATALOG:COLUMN

Open jw1u1 opened this issue 3 years ago • 2 comments

Some Tables are migrated, the most are not. Any helpful error message given, neither in the logs.

LOAD DATABASE FROM postgres://pgmigrator@:6432/foo_system_slot0 INTO pgsql://postgres@/foo_slot0

WITH include drop, create tables, create indexes, reset sequences

SET PostgreSQL PARAMETERS maintenance_work_mem to '128MB', work_mem to '12MB'

alter schema 'public' rename to 'foo_slot0' ;

$ pgloader pgloader.conf 2022-11-17T17:39:53.012001Z LOG pgloader version "3.6.7~devel" 2022-11-17T17:39:53.072001Z LOG Migrating from #<PGSQL-CONNECTION pgsql://pgmigrator@UNIX:6432/foo_system_slot0 {1006434383}> 2022-11-17T17:39:53.072001Z LOG Migrating into #<PGSQL-CONNECTION pgsql://postgres@UNIX:5432/foo_slot0 {100645E1B3}> KABOOM! TYPE-ERROR: The value NIL is not of type PGLOADER.CATALOG:COLUMN An unhandled error condition has been signalled: The value NIL is not of type PGLOADER.CATALOG:COLUMN

What I am doing here?

The value NIL is not of type PGLOADER.CATALOG:COLUMN

jw1u1 avatar Nov 17 '22 17:11 jw1u1

@jw1u1 I just ran into this today and I am wondering if you figured it out?

nleroy917 avatar Jan 07 '25 23:01 nleroy917

I solved it by identifying tables where column_name is null. It ended up being some obscure indexes created:

select table_schema, table_name, index_name, column_name
    from information_schema.STATISTICS
where table_schema = '<db-name>'
    and column_name is NULL;

for each result, just run:

alter table <offending_table_name> drop index <index_name>;

I found five in my database I had to drop. you would, of course, need to recreate these afterwards manually in postgres.

nleroy917 avatar Jan 08 '25 17:01 nleroy917