Skip to content

Unexpected error: Unsupported PostgreSQL type: name #51

@tsg

Description

@tsg
  • Version: 0.51.1
  • OS: darwin-arm64

Reporting just for completeness, I have a workaround by not sync-ing that table.

This seems to happen due to the use of a custom type pg_catalog.name in the pgroll migrations table.

The description of the table is:

\d pgroll.migrations
                                    Table "pgroll.migrations"
      Column      |           Type           | Collation | Nullable |           Default
------------------+--------------------------+-----------+----------+-----------------------------
 schema           | name                     |           | not null |
 name             | text                     |           | not null |
 migration        | jsonb                    |           | not null |
 created_at       | timestamp with time zone |           | not null | CURRENT_TIMESTAMP
 updated_at       | timestamp with time zone |           | not null | CURRENT_TIMESTAMP
 parent           | text                     |           |          |
 done             | boolean                  |           | not null | false
 resulting_schema | jsonb                    |           | not null | '{}'::jsonb
 migration_type   | character varying(32)    |           |          | 'pgroll'::character varying
Indexes:
    "migrations_pkey" PRIMARY KEY, btree (schema, name)
    "history_is_linear" UNIQUE, btree (schema, parent)
    "only_first_migration_without_parent" UNIQUE, btree (schema) WHERE parent IS NULL
    "only_one_active" UNIQUE, btree (schema, name, done) WHERE done = false
Check constraints:
    "migration_type_check" CHECK (migration_type::text = ANY (ARRAY['pgroll'::character varying, 'inferred'::character varying]::text[]))
Foreign-key constraints:
    "migrations_schema_parent_fkey" FOREIGN KEY (schema, parent) REFERENCES pgroll.migrations(schema, name)
Referenced by:
    TABLE "pgroll.migrations" CONSTRAINT "migrations_schema_parent_fkey" FOREIGN KEY (schema, parent) REFERENCES pgroll.migrations(schema, name)

And the type:

app=# \dT name;
                       List of data types
   Schema   | Name |                 Description
------------+------+---------------------------------------------
 pg_catalog | name | 63-byte type for storing system identifiers
(1 row)

You can probably treat it as a string.

Unsupported PostgreSQL type: name

goroutine 1 [running]:
runtime/debug.Stack()
	/nix/store/nvaay1c4banbccyvv6ba1gzyqpypjmfq-go-1.23.1/share/go/src/runtime/debug/stack.go:26 +0x64
main.printUnexpectedError(0x105937020?, {0x10522efd8?, 0x14000ef1690?})
	/Users/exaspark/Documents/Code/BemiHQ/BemiDB/src/error_utils.go:44 +0x40
main.PanicIfError(0x105937020, {0x10522efd8, 0x14000ef1690})
	/Users/exaspark/Documents/Code/BemiHQ/BemiDB/src/error_utils.go:21 +0x44
main.Panic(...)
	/Users/exaspark/Documents/Code/BemiHQ/BemiDB/src/error_utils.go:28
main.(*PgSchemaColumn).parquetPrimitiveTypes(0x14000056e48)
	/Users/exaspark/Documents/Code/BemiHQ/BemiDB/src/pg_schema_column.go:377 +0x80c
main.(*PgSchemaColumn).toParquetSchemaField(0x14000056e48)
	/Users/exaspark/Documents/Code/BemiHQ/BemiDB/src/pg_schema_column.go:182 +0x40
main.PgSchemaColumn.ToParquetSchemaFieldMap({{0x1400101a304, 0x6}, {0x1400101a30c, 0x4}, {0x1400101a310, 0x4}, {0x1400101a314, 0x2}, {0x104907698, 0x1}, ...})
	/Users/exaspark/Documents/Code/BemiHQ/BemiDB/src/pg_schema_column.go:75 +0x28
main.(*StorageUtils).buildSchemaJson(0x140000924b0, {0x140007b8008, 0x9, 0x14000057058?})
	/Users/exaspark/Documents/Code/BemiHQ/BemiDB/src/storage_utils.go:1249 +0x158
main.(*StorageUtils).WriteParquetFile(0x140000924b0, {0x1052422e0, 0x14000ee3170}, {0x140007b8008, 0x9, 0x0?}, 0x80000000, 0x14000882190)
	/Users/exaspark/Documents/Code/BemiHQ/BemiDB/src/storage_utils.go:550 +0x90
main.(*StorageLocal).CreateParquet(0x14000ef1670, {0x14000742a40, 0x32}, {0x140007b8008, 0x9, 0x11}, 0x80000000, 0x14000882190)
	/Users/exaspark/Documents/Code/BemiHQ/BemiDB/src/storage_local.go:154 +0x244
main.(*IcebergWriterTable).Write(0x14000057990, 0x14000882190)
	/Users/exaspark/Documents/Code/BemiHQ/BemiDB/src/iceberg_writer_table.go:57 +0x2d4
main.(*SyncerTable).SyncPgTable(0x14000092dd0, {{0x14000716920, 0x6}, {0x140012560e0, 0xa}, {0x0, 0x0}}, 0x14000001440, 0x1400072c5a0, {{0x0, ...}, ...}, ...)
	/Users/exaspark/Documents/Code/BemiHQ/BemiDB/src/syncer_table.go:85 +0x818
main.(*Syncer).SyncFromPostgres(0x140000f7ba0)
	/Users/exaspark/Documents/Code/BemiHQ/BemiDB/src/syncer.go:79 +0x4a0
main.syncFromPg(0x105937020)
	/Users/exaspark/Documents/Code/BemiHQ/BemiDB/src/main.go:93 +0x24
main.main()
	/Users/exaspark/Documents/Code/BemiHQ/BemiDB/src/main.go:53 +0x1f0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions