patch I posted) that contains a list of NamedTuplestore pointers (the SpiRelation struct in the patch I posted, renamed) and in future perhaps lists of other ephemeral/transient objects that we want to expose to SQL?
Very good idea. Sooner or later someone will probably want query-scoped variables like MS-SQL and MySQL for example.