bool_plperlu

transform between bool and plperlu

Overview

PackageVersionCategoryLicenseLanguage
plperlu1.0LANGPostgreSQLC
IDExtensionBinLibLoadCreateTrustRelocSchema
3270plperluNoYesNoYesNoNo-
3271bool_plperluNoNoNoYesNoNo-
3272jsonb_plperluNoNoNoYesNoNo-
3273hstore_plperluNoNoNoYesNoNo-
Relatedplperlu plperl bool_plperl plpgsql pg_tle plv8

Version

PG18PG17PG16PG15PG14
1.01.01.01.01.0

Install

Note: This is a built-in contrib extension of PostgreSQL

CREATE EXTENSION bool_plperlu;

Usage

bool_plperlu: Transform between bool and PL/Perl untrusted

Provides a transform for the bool type for PL/Perl Untrusted. When loaded, PostgreSQL boolean values are automatically converted to Perl native boolean representations and vice versa, instead of being passed as strings.

CREATE EXTENSION bool_plperlu;

CREATE FUNCTION check_flag_u(val boolean) RETURNS text
LANGUAGE plperlu TRANSFORM FOR TYPE boolean AS $$
  # val is a native Perl boolean (1 or undef), not a string
  if ($_[0]) {
    return "flag is set";
  }
  return "flag is not set";
$$;

SELECT check_flag_u(true);   -- flag is set
SELECT check_flag_u(false);  -- flag is not set

Last Modified 2026-03-12: add pg extension catalog (95749bf)