postgresql/src/pl/plperl
Peter Eisentraut d56cb42b54 Activate perlcritic InputOutput::RequireCheckedSyscalls and fix resulting warnings
This checks that certain I/O-related Perl functions properly check
their return value.  Some parts of the PostgreSQL code had been a bit
sloppy about that.  The new perlcritic warnings are fixed here.  I
didn't design any beautiful error messages, mostly just used "or die
$!", which mostly matches existing code, and also this is
developer-level code, so having the system error plus source code
reference should be ok.

Initially, we only activate this check for a subset of what the
perlcritic check would warn about.  The effective list is

    chmod flock open read rename seek symlink system

The initial set of functions is picked because most existing code
already checked the return value of those, so any omissions are
probably unintended, or because it seems important for test
correctness.

The actual perlcritic configuration is written as an exclude list.
That seems better so that we are clear on what we are currently not
checking.  Maybe future patches want to investigate checking some of
the other functions.  (In principle, we might eventually want to check
all of them, but since this is test and build support code, not
production code, there are probably some reasonable compromises to be
made.)

Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Discussion: https://www.postgresql.org/message-id/flat/88b7d4f2-46d9-4cc7-b1f7-613c90f9a76a%40eisentraut.org
2024-03-19 07:09:31 +01:00
..
expected Don't specify number of dimensions in cases where we don't know it. 2023-11-17 11:29:46 -05:00
po Update copyright for 2024 2024-01-03 20:49:05 -05:00
sql Tighten array dimensionality checks in Perl -> SQL array conversion. 2023-04-29 13:06:44 -04:00
.gitignore Allow make check in PL directories 2011-02-15 06:52:12 +02:00
GNUmakefile Hide warnings from Python headers when using gcc-compatible compiler. 2023-12-26 16:16:37 -05:00
README Stop generating plain-text INSTALL instructions. 2023-12-22 13:32:15 -05:00
SPI.xs Be more careful to avoid including system headers after perl.h 2022-08-27 14:45:18 +07:00
Util.xs New header varatt.h split off from postgres.h 2023-01-10 05:54:36 +01:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
nls.mk Revert "Use wildcards instead of manually-maintained file lists in */nls.mk." 2022-07-13 14:29:10 -04:00
plc_perlboot.pl Update copyright for 2024 2024-01-03 20:49:05 -05:00
plc_trusted.pl Update copyright for 2024 2024-01-03 20:49:05 -05:00
plperl--1.0.sql Invent "trusted" extensions, and remove the pg_pltemplate catalog. 2020-01-29 18:42:43 -05:00
plperl.c Don't specify number of dimensions in cases where we don't know it. 2023-11-17 11:29:46 -05:00
plperl.control Invent "trusted" extensions, and remove the pg_pltemplate catalog. 2020-01-29 18:42:43 -05:00
plperl.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
plperl_opmask.pl Update copyright for 2024 2024-01-03 20:49:05 -05:00
plperl_system.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
plperlu--1.0.sql Invent "trusted" extensions, and remove the pg_pltemplate catalog. 2020-01-29 18:42:43 -05:00
plperlu.control Create extension infrastructure for the core procedural languages. 2011-03-04 21:51:14 -05:00
ppport.h Remove HP-UX port. 2022-07-08 14:05:05 +12:00
text2macro.pl Activate perlcritic InputOutput::RequireCheckedSyscalls and fix resulting warnings 2024-03-19 07:09:31 +01:00

README

src/pl/plperl/README

PL/Perl allows you to write PostgreSQL functions and procedures in
Perl.  To include PL/Perl in the build use './configure --with-perl'.
To build from this directory use 'make all; make install'.  libperl
must have been built as a shared library, which is usually not the
case in standard installations.

Consult the PostgreSQL User's Guide for more information.