On 2024-01-19 22:15 +0100, Tom Lane wrote:
> "David E. Wheeler" <david@justatheory.com> writes:
> > [ v7-0001-Improve-boolean-predicate-JSON-Path-docs.patch ]
>
> + \set json '{
> "track": {
> "segments": [
> {
>
> I find the textual change rather unwieldy, but the bigger problem is
> that this example doesn't actually work. If you try to copy-and-paste
> this into psql, you get "unterminated quoted string", because psql
> metacommands can't span line boundaries.
Interesting... copy-pasting the entire \set command works for me with
psql 16.1 in gnome-terminal and tmux. Typing it out manually gives me
the "unterminated quoted string" error. Maybe has to do with my stty
settings.
> I experimented with
>
> SELECT '
> ... multiline json value ...
> ' AS json
> \gexec
>
> but that didn't seem to work either. Anybody have a better idea?
Fine with me (the \gset variant).
--
Erik