Re: Idea on how to simplify comparing two sets

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Joel Jacobson <joel(at)trustly(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Idea on how to simplify comparing two sets
Date: 2017-02-23 21:16:07
Message-ID: 595203eb-73c3-cffa-7b7d-3f35d87e575a@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2/7/17 12:03 PM, Tom Lane wrote:
>> That said I'm not sure how much we want to go down this road on our own.
>> It'd be nice to have when its needed but its not something that gets much
>> visibility on these lists to suggest a large pent-up demand.
> Yeah, if this isn't in the standard and not in other databases either,
> that would seem to suggest that it's not a big requirement.

FWIW I've found myself needing the precursor to this this (give me the
full diff) at least a couple times, and it's quite a PITA on anything
but a trivial relation.

It's also not possible to make this easier via an SRF because you don't
know in advance what the result set looks like. So the best I've ever
come up with is a file that can be included in psql that depends on
having set two psql variables to the names of relations that can be
queried (and if you need more than a relation you need to create a temp
view).

I've wondered about the possibility of allowing PLs the ability to
dynamically define their return type based on their arguments. That
would allow for an SRF to handle this case, and would be significantly
more flexible than trying to do that using pseudotypes.
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2017-02-23 21:20:44 Re: PinBuffer() no longer makes use of strategy
Previous Message Tom Lane 2017-02-23 21:08:58 Re: bytea_output output of base64