bool_plperlu
transform between bool and plperlu
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
plperlu | 1.0 | LANG | PostgreSQL | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 3270 | plperlu | No | Yes | No | Yes | No | No | - |
| 3271 | bool_plperlu | No | No | No | Yes | No | No | - |
| 3272 | jsonb_plperlu | No | No | No | Yes | No | No | - |
| 3273 | hstore_plperlu | No | No | No | Yes | No | No | - |
| Related | plperlu plperl bool_plperl plpgsql pg_tle plv8 |
|---|
Version
| PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|
| 1.0 | 1.0 | 1.0 | 1.0 | 1.0 |
Install
Note: This is a built-in contrib extension of PostgreSQL
CREATE EXTENSION bool_plperlu;
Usage
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
Feedback
Was this page helpful?
Thanks for the feedback! Please let us know how we can improve.
Sorry to hear that. Please let us know how we can improve.