On 2019-06-17 18:39, Andres Freund wrote:
> Basically something like:
>
> \gset SELECT my_encodings_are_compatible() AS compatible
> \if :compatible
> test;
> contents;
> \endif
Cool, that works out quite well. See attached patch. I flipped the
logic around to make it \quit if not compatible. That way the
alternative expected file is shorter and doesn't need to be updated all
the time. But it gets the job done either way.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services