Re: BUG #19084: dump/restore table doesn't work with GENARETED column and custom type and cast in function - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: BUG #19084: dump/restore table doesn't work with GENARETED column and custom type and cast in function
Date
Msg-id CAKFQuwb08rC541j4ibPEuF5SPx90FTOX5Q3DjmknmL4ybSMGTg@mail.gmail.com
Whole thread Raw
In response to BUG #19084: dump/restore table doesn't work with GENARETED column and custom type and cast in function  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
On Mon, Oct 13, 2025, 10:38 PG Bug reporting form <noreply@postgresql.org> wrote:
The following bug has been logged on the website:

Bug reference:      19084
Logged by:          David Turoň
Email address:      turon.david@seznam.cz
PostgreSQL version: 17.6
Operating system:   AlmaLinux release 9.0
Description:       


pg_restore: error: could not execute query: ERROR:  type "test_type" does
not exist
LINE 1:  SELECT array_agg((e->>'item')::test_type) FROM jsonb_array_...
     

This is an application bug, not Postgres.  You relied on the public schema being in search_path but didn't declare that fact via SET on the function.  Either use SET, or schema-qualify objects so you don't have to rely on search_path at all.

David J.

pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #19084: dump/restore table doesn't work with GENARETED column and custom type and cast in function
Next
From: Tom Lane
Date:
Subject: Re: BUG #19084: dump/restore table doesn't work with GENARETED column and custom type and cast in function