From: | Ron <ronljohnsonjr(at)gmail(dot)com> |
---|---|
To: | pgsql-general(at)lists(dot)postgresql(dot)org |
Subject: | Re: View definition changes after reloading pg_dump export |
Date: | 2022-09-01 14:36:14 |
Message-ID: | 1993dc39-b60a-cdd8-e8bb-a6cb261185d2@gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On 9/1/22 09: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. Formally speaking it shouldn't
> do that, because the parser may act differently depending on whether
> a cast is explicitly present, as indeed you see here. But if we don't
> write the coercions explicitly then there is a risk of the reloaded view
> being interpreted differently than it was before (perhaps because there
> are more or different overloaded functions/operators available at reload
> time). So the dumping logic is kind of between a rock and a hard place.
> Our experience has been that printing the coercions explicitly causes
> fewer problems than not doing so, so that's what it does.
>
> regards, tom lane
>
>
"foo.baz::character varying::text" seems pretty odd.
--
Angular momentum makes the world go 'round.
From | Date | Subject | |
---|---|---|---|
Next Message | V | 2022-09-01 17:14:24 | Diffs in PG output vs WAL |
Previous Message | Wesley Schwengle | 2022-09-01 14:35:20 | Re: View definition changes after reloading pg_dump export |