Re: View definition changes after reloading pg_dump export

From: Wesley Schwengle <wesley(dot)schwengle(at)xxllnc(dot)nl>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: View definition changes after reloading pg_dump export
Date: 2022-09-01 14:35:20
Message-ID: 6310c32a.050a0220.40c46.6019@mx.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 9/1/22 10:08, Tom Lane wrote:
> Wesley Schwengle <wesley(dot)schwengle(at)xxllnc(dot)nl> writes:
>> There is a view that we create and it uses a function and the view
>> definition changes between runs. I'm not sure why this is happening,
>> does someone know?
>
> The core reason for the discrepancy is that the parser inserts
> implicit coercion steps into your initial, not-very-consistently-typed
> query; but the view-dumping logic (ruleutils.c) tends to display
> those steps as explicit coercions.

Thanks for the clarification, it makes a whole lot of sense. And indeed,
when I type the SQL like so ARRAY[foo.bar::text, foo.baz::varchar::text]
the view definition does not change between runs.

Cheers,
Wesley

--
Wesley Schwengle, Developer
xxllnc Zaaksysteem, https://www.zaaksysteem.nl

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ron 2022-09-01 14:36:14 Re: View definition changes after reloading pg_dump export
Previous Message Tom Lane 2022-09-01 14:08:47 Re: View definition changes after reloading pg_dump export