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

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: turon(dot)david(at)seznam(dot)cz, PostgreSQL Bug List <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #19084: dump/restore table doesn't work with GENARETED column and custom type and cast in function
Date: 2025-10-13 15:19:46
Message-ID: CAKFQuwb08rC541j4ibPEuF5SPx90FTOX5Q3DjmknmL4ybSMGTg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Oct 13, 2025, 10:38 PG Bug reporting form <noreply(at)postgresql(dot)org>
wrote:

> The following bug has been logged on the website:
>
> Bug reference: 19084
> Logged by: David Turoň
> Email address: turon(dot)david(at)seznam(dot)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.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2025-10-13 15:29:12 Re: BUG #19084: dump/restore table doesn't work with GENARETED column and custom type and cast in function
Previous Message PG Bug reporting form 2025-10-13 13:32:33 BUG #19084: dump/restore table doesn't work with GENARETED column and custom type and cast in function