pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: View definition changes after reloading pg_dump export
Date: Thu, 1 Sep 2022 09:36:14 -0500
Message-ID: <1993dc39-b60a-cdd8-e8bb-a6cb261185d2@gmail.com> (raw)
In-Reply-To: <402822.1662041327@sss.pgh.pa.us>
References: <58cef826-706a-3838-3ce3-e6011c2ccd76@exxellence.nl>
	<402822.1662041327@sss.pgh.pa.us>



On 9/1/22 09:08, Tom Lane wrote:
> Wesley Schwengle <wesley.schwengle@xxllnc.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.





view thread (4+ messages)

Message-ID: <1993dc39-b60a-cdd8-e8bb-a6cb261185d2@gmail.com>
Permalink:  ../1993dc39-b60a-cdd8-e8bb-a6cb261185d2@gmail.com/
Also on:    postgresql.org/message-id/1993dc39-b60a-cdd8-e8bb-a6cb261185d2@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: ronljohnsonjr@gmail.com
  Subject: Re: View definition changes after reloading pg_dump export
  In-Reply-To: <1993dc39-b60a-cdd8-e8bb-a6cb261185d2@gmail.com>
  References: <58cef826-706a-3838-3ce3-e6011c2ccd76@exxellence.nl> <402822.1662041327@sss.pgh.pa.us> <1993dc39-b60a-cdd8-e8bb-a6cb261185d2@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox