Weird "null" errors during DROP TYPE (pg_upgrade)

From: Devrim Gündüz <devrim(at)gunduz(dot)org>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Weird "null" errors during DROP TYPE (pg_upgrade)
Date: 2024-05-02 23:36:33
Message-ID: b874eb76285f7f894aaa8e5d3ac106a1a73abd99.camel@gunduz.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hi,

pg_ugprade from v15 to v16 failed in an environment. Often we get a
reasonable message, but this time it was a bit weird. First, error
message:

=====================================================================================
pg_restore: creating TYPE "foobar._packagestoptemp"
pg_restore: while PROCESSING TOC:
pg_restore: from TOC entry 2418; 1247 20529 TYPE _packagestoptemp developer
pg_restore: error: could not execute query: ERROR: type "_packagestoptemp" does not exist
HINT: Create the type as a shell type, then create its I/O functions, then do a full CREATE TYPE.
Command was:
-- For binary upgrade, must preserve pg_type oid
SELECT pg_catalog.binary_upgrade_set_next_pg_type_oid('20529'::pg_catalog.oid);

CREATE TYPE "foobar"."_packagestoptemp" (
INTERNALLENGTH = variable,
INPUT = "array_in",
OUTPUT = "array_out",
RECEIVE = "array_recv",
SEND = "array_send",
ANALYZE = "array_typanalyze",
SUBSCRIPT = "array_subscript_handler",
ELEMENT = ???,
CATEGORY = 'A',
ALIGNMENT = double,
STORAGE = extended
);
=====================================================================================

We noticed that this data type was actually not used, so decided to drop it:

===================
DROP TYPE "foobar"."_packagestoptemp";
ERROR: cannot drop (null) because (null) requires it
HINT: You can drop (null) instead.

===================

What do these "null" mean here? Any hints?,

Thanks!

Regards,
--
Devrim Gündüz
Open Source Solution Architect, PostgreSQL Major Contributor
Twitter: @DevrimGunduz , @DevrimGunduzTR

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Devrim Gündüz 2024-05-02 23:37:31 Re: HEAD build error on Fedora 39
Previous Message Jacob Champion 2024-05-02 23:29:18 Re: [PATCH] json_lex_string: don't overread on bad UTF8