Re: Query execution in Perl TAP tests needs work - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Query execution in Perl TAP tests needs work
Date
Msg-id CA+TgmobXRn4QdJiD4eE_w9sKtPPohFrB3c4Dy_129cSR7tf8+A@mail.gmail.com
Whole thread Raw
In response to Re: Query execution in Perl TAP tests needs work  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Query execution in Perl TAP tests needs work
List pgsql-hackers
On Wed, Oct 18, 2023 at 11:43 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Having said that ... I read the man page for FFI::Platypus,
> and I'm failing to draw a straight line between what it can do
> and what we need.  Aren't we going to need a big chunk of new
> Perl code anyway?  If so, why not write a big chunk of new Perl
> that doesn't have new external dependencies?

I think that the question here is what exactly the Perl code that we'd
have to write would be doing.

If we use FFI::Platypus, our Perl code can directly call libpq
functions. The Perl code would just be a wrapper around those function
calls, basically. I'm sure there's some work to be done there but a
lot of it is probably boilerplate.

Without FFI::Platypus, we have to write Perl code that can speak the
wire protocol directly. Basically, we're writing our own PostgreSQL
driver for Perl, though we might need only a subset of the things a
real driver would need to handle, and we might add some extra things,
like code that can send intentionally botched protocol messages.

I think it's a judgement call which is better. Depending on
FFI::Platypus is annoying, because nobody likes dependencies. But
writing a new implementation of the wire protocol is probably more
work, and once we wrote it, we'd also need to maintain it and debug it
and stuff. We would probably be able to gain some test coverage of
situations that libpq won't let you create, but we would also perhaps
lose some test coverage for libpq itself.

I feel like either way is a potentially viable way forward, and where
we end up might end up depending on who is willing to do the work and
what that person would prefer to do.

--
Robert Haas
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Query execution in Perl TAP tests needs work
Next
From: Christoph Berg
Date:
Subject: Re: pgsql: Generate automatically code and documentation related to wait ev