pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Ken Tanzer <ken.tanzer@gmail.com>
Cc: PG-General Mailing List <pgsql-general@postgresql.org>
Subject: Re: Cosmetically-varying casts added to view definitions
Date: Mon, 30 Jul 2018 17:22:58 -0700
Message-ID: <7f58be67-7d02-05aa-c7f1-c343b0488f36@aklaver.com> (raw)
In-Reply-To: <CAD3a31VCsQZY8_BSyT7ETPp0t-0zfCodU86vWKnZZEc2zM8Svg@mail.gmail.com>
References: <CAD3a31Vrc1cHZC588JNuYq_oHN2COD1=G5=mecVawbLfb_Vbbg@mail.gmail.com>
	<ac9707c4-bb07-8dfb-548e-8821be3bde0f@aklaver.com>
	<CAD3a31VvLp_hp8sVcJM4A85QC1-qj2XDtdYAAkM96SR1uyn0gA@mail.gmail.com>
	<a6444e8b-038c-7009-e50d-5f43991719e6@aklaver.com>
	<CAD3a31VCsQZY8_BSyT7ETPp0t-0zfCodU86vWKnZZEc2zM8Svg@mail.gmail.com>

On 07/30/2018 04:57 PM, Ken Tanzer wrote:
> On Mon, Jul 30, 2018 at 4:52 PM Adrian Klaver <adrian.klaver@aklaver.com 
> <mailto:adrian.klaver@aklaver.com>> wrote:
> 
>     On 07/30/2018 04:29 PM, Ken Tanzer wrote:
>      > On Mon, Jul 30, 2018 at 4:10 PM Adrian Klaver
>     <adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
> 
>      > Thanks Adrian.  I do have what are supposed to be the original view
>      > definitions, but I'm less than 100% confident they are accurate and
>      > up-to-date, which is why I thought to use the actual definitions as
>      > stored.  Might have to rethink that one though, or just take a
>     leap of
>      > faith that the views will functionally be the same!
> 
>     Or write a test or tests to verify they are the same.
> 
> 
> How would you do that exactly?  I can see verifying that they return the 
> same rows given existing data, but not that this would be true with 
> different data.

Well if the different definitions of the view are returning the exact 
same data currently that would mean to me their selection criteria are 
the same. Any data in the future would be subjected to the same criteria 
so there would not be a problem. That is unless you want to change the 
criteria in the future and which point you would need to decide which 
view definition to base the changes off.

> 
> Did you mean comparing the returned results, writing some view-specific 
> tests on a case-by-case basis, or something way way better that I'm not 
> grasping?

I would say comparing the results. You know what you want the view to 
return, so select from it for known values and see if it returns what 
you expect.

> 
> Thanks!
> 
> Ken
> -- 
> AGENCY Software


-- 
Adrian Klaver
adrian.klaver@aklaver.com




view thread (6+ messages)

Message-ID: <7f58be67-7d02-05aa-c7f1-c343b0488f36@aklaver.com>
Permalink:  ../7f58be67-7d02-05aa-c7f1-c343b0488f36@aklaver.com/
Also on:    postgresql.org/message-id/7f58be67-7d02-05aa-c7f1-c343b0488f36@aklaver.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: adrian.klaver@aklaver.com, ken.tanzer@gmail.com
  Subject: Re: Cosmetically-varying casts added to view definitions
  In-Reply-To: <7f58be67-7d02-05aa-c7f1-c343b0488f36@aklaver.com>
  References: <CAD3a31Vrc1cHZC588JNuYq_oHN2COD1=G5=mecVawbLfb_Vbbg@mail.gmail.com> <ac9707c4-bb07-8dfb-548e-8821be3bde0f@aklaver.com> <CAD3a31VvLp_hp8sVcJM4A85QC1-qj2XDtdYAAkM96SR1uyn0gA@mail.gmail.com> <a6444e8b-038c-7009-e50d-5f43991719e6@aklaver.com> <CAD3a31VCsQZY8_BSyT7ETPp0t-0zfCodU86vWKnZZEc2zM8Svg@mail.gmail.com> <7f58be67-7d02-05aa-c7f1-c343b0488f36@aklaver.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