bool_plperl

transform between bool and plperl

Overview

PackageVersionCategoryLicenseLanguage
plperl1.0LANGPostgreSQLC
IDExtensionBinLibLoadCreateTrustRelocSchema
3260plperlNoYesNoYesYesNopg_catalog
3261bool_plperlNoYesNoYesYesNo-
3262hstore_plperlNoYesNoYesNoNo-
3263jsonb_plperlNoNoNoYesYesNo-
Relatedplperl plperlu bool_plperlu 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_plperl;

Usage

bool_plperl: Transform between bool and PL/Perl

Provides a transform for the bool type for PL/Perl. 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_plperl;

CREATE FUNCTION check_flag(val boolean) RETURNS text
LANGUAGE plperl 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(true);   -- flag is set
SELECT check_flag(false);  -- flag is not set

Last Modified 2026-03-14: update extension metadata (24c6e3f)