As I was playing around with prelimiary stuff for regression testing the
CSV patch, I had a couple of ideas I thought I might float.
Context: many of the tests will write a table out and read it back into
a duplicate table and then perform a symmetric difference on the 2
tables. Making the query for this is slightly error prone, so I made two
functions, one to generate the query in text, and the other perform the
query and return a set of records.
Idea 1: an eval facility for psql. e.g.:
\eval symdiffgen('foo','bar')
or
\eval select symdiffgen('foo','bar')
This would be a use of the first query. In effect we'd be providing for
a sort of macro facility.
Idea 2: allow a LIKE clause in the column specs where a function
returning a set of records is called. e.g., instead of
select * from symdiff('foo','bar') as diff(_table_name_ text, d date,
x text);
allow
select * from symdiff('foo','bar') as diff(_table_name_ text, like foo);
There may be good reasons not to do either of these, so I am just
floating them for discussion.
I might also have missed something obvious that would let me do things
easily some other way.
cheers
andrew