Re: drop tablespace failed when location contains .. on win32

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: "wangsh(dot)fnst(at)fujitsu(dot)com" <wangsh(dot)fnst(at)fujitsu(dot)com>
Cc: Julien Rouhaud <rjuju123(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, "andrew(at)dunslane(dot)net" <andrew(at)dunslane(dot)net>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: drop tablespace failed when location contains .. on win32
Date: 2022-01-24 11:46:25
Message-ID: Ye6Rkd1kLvhkTJa1@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jan 24, 2022 at 11:21:12AM +0000, wangsh(dot)fnst(at)fujitsu(dot)com wrote:
> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> I concur with the upthread comments that there's little chance
>>> we'll commit 0003 as-is; the code-to-benefit ratio is too high.
>>> Instead, you might consider adding test_canonicalize_path in
>>> src/test/regress/regress.c, and then adding a smaller number
>>> of regression test cases using that.
>>
>> Sounds like a good idea to me. I would move these in misc.source for
>> anything that require an absolute path.
>
> I'm not fully understand this. So, I do not change the test patch.

In order to make the tests cheap, there is no need to have a separate
module in src/test/modules/ as your patch 0002 is doing. Instead, you
should move the C code of your SQL function test_canonicalize_path()
to src/test/regress/regress.c, then add some tests in
src/test/regress/sql/, with a SQL function created in the test script
that feeds from what would be added to regress.so.

Please note that my previous comment has become incorrect as of
dc9c3b0, that has removed the concept of input/output files in the
regression tests, but you can do the same with a \getenv to get access
to absolute paths for the tests. There are many examples in the tree
for that, one is copy.sql.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2022-01-24 12:05:50 Re: [BUG]Update Toast data failure in logical replication
Previous Message Pavel Stehule 2022-01-24 11:33:11 Re: Schema variables - new implementation for Postgres 15