Re: Tests for psql \g and \o

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: "Michael Paquier" <michael(at)paquier(dot)xyz>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Tests for psql \g and \o
Date: 2022-11-23 20:18:57
Message-ID: f6a30254-d9cb-4e2a-9c77-21dcaf6c0100@manitou-mail.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Michael Paquier wrote:

> +psql_like($node, "SELECT 'one' \\g | cat >$g_file", qr//, "one command
> \\g");
> +my $c1 = slurp_file($g_file);
> +like($c1, qr/one/);
>
> Windows may not have an equivalent for "cat", no? Note that psql's
> 001_basic.pl has no restriction in place for Windows. Perhaps you
> could use the same trick as basebackup_to_shell, where GZIP is used to
> write some arbitrary data.. Anyway, this has some quoting issues
> especially if the file's path has whitespaces? This is located in
> File::Temp::tempdir, still it does not sound like a good thing to rely
> on this assumption on portability grounds.

PFA a new patch addressing these issues.

Best regards,
--
Daniel Vérité
https://postgresql.verite.pro/
Twitter: @DanielVerite

Attachment Content-Type Size
tests-psql-g-o-file-v2.patch text/plain 6.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2022-11-23 20:25:39 Re: Add sub-transaction overflow status in pg_stat_activity
Previous Message Justin Pryzby 2022-11-23 20:16:20 Re: Documentation for building with meson