Questions tagged [plperl]

plperl/plperlu A perl language extension for use within the PostgreSQL object relational database for creating user defined functions.

plperl and plperlu are procedural language extensions that can be used within the PostgreSQL object relational database for creating user-defined functions.

plperl uses a restricted subset of the full perl language functionality to enable a more security aware set of the perl language features for use within PostgreSQL.

plperlu is an less restrictive feature set of the perl language for use within PostgreSQL. plperlu allows the use of feature such as external modules and filesystem access. The use of plperlu should be carefully reviewed for security conscious environments.

38 questions
2
votes
1 answer

Database Access from PL/Perl Code

Could someone please assist to rectify the errors in this piece of code. (this is just a simplified version of my code, but it identifies the issues). DROP FUNCTION perl_func(VARIADIC params character varying[]); CREATE OR REPLACE FUNCTION…
Larry
  • 11,439
  • 15
  • 61
  • 84
1
vote
0 answers

Global variables implementation using plperl/plpython in postgres is throwing out of memory

We are actually migrating db from oracle to postgres. We are using postgreSQL 11. So the packages are converted to procedures/functions accordingly. For global variables implementation we used the local configuration setting as below SET…
1
vote
1 answer

Using "plperl" for Calling RESTful Web Services from PostgreSQL procedure/function with plperl pg_available_extensions

I would like to call a RESTful Web Services from PostgreSQL procedure/function using "plperl". I can 'not' use plperlu, plpython2u, JOOQ or Hibernate. So I would like to use something "like" the "plperlu" PostgreSQL-proc example from the following…
1
vote
1 answer

Returning MSSQL data using plperl function in PostgreSQL

I have a PostgreSQL database in use for a complex php web site (And VB.Net/C# management applications) which require access to execute stored procedures on a Microsoft SQL Server 2008 database. The method chosen to perform this interaction is to…
Shane Brodie
  • 117
  • 1
  • 1
  • 8
1
vote
1 answer

Accessing current_settings function within a plperl function in Postgres

I am writing my first plperl function in Postgres and I have a need to access some values in the current_settings() area (by use of that call) -- and I am wondering what the best solution to doing so is? In plpgsql I can do something like: DECLARE …
sjmcdowall
  • 1,471
  • 4
  • 15
  • 27
1
vote
2 answers

How do I handle interrupts (i.e. SIGTERM or SIGINT)

I have a function that does quite a bit of intensive processing. Once in awhile I need to be able to stop it (i.e. for DB maintenance) even if it's mid-run. I'd like to send it a SIGINT so it can wind up what it's doing gracefully. What I found…
Ryley
  • 21,046
  • 2
  • 67
  • 81
1
vote
1 answer

Postgres plperl - Create Aggregate Function to Average Decibles

I'm trying to take all the dBm values for a date and average them, but to average dBm they need to be converted to watts, averaged, then converted back to dBm. Here is what I tried with plperl. CREATE OR REPLACE FUNCTION avg_dbm(double precision[])…
atom12
  • 32
  • 1
  • 6
1
vote
2 answers

How to do date/time manipulations in PostgreSQL PLPerl function

While writing Postgres functions (stored procedures) in plperl I've learned that it's not possible to load perl modules such as "use Time::Piece;". Given that, what's the best way to handle date/time manipulations and comparisons in plperl? Using…
dougj
  • 23
  • 3
1
vote
1 answer

How to tell PostgreSQL to use other Perl-Version?

Im working on a Ubuntu 14.04 64bit machine. I need to use Perl 5.14 to work with certain modules which wont install with the newest version of perl (5.18). My postgresql-9.3 server needs to install perl 5.18 while installing…
oszd93
  • 193
  • 1
  • 2
  • 9
1
vote
1 answer

Accessing data on Microsoft SQL Server from a PostgreSQL function

I have an application that uses PostgreSQL but also interacts with a third-party-controlled database on MSSQL. The data are sometimes tied together closely enough that it becomes desirable to do things like: select thing_from_pg,…
Kev
  • 15,899
  • 15
  • 79
  • 112
0
votes
1 answer

PostgreSQL 15.3 / Plperl

I've installed PostgreSQL 15.3 on a clean windows 10 laptop with the v3 language pack and I've set the correct paths and environment variables. I can install pltcl and plpython3u languages on the database but plperl will not install. Its reporting…
Foxy
  • 81
  • 1
  • 1
  • 6
0
votes
0 answers

PostgreSQL 15 with plperl: lc_monetary problem (works with Postgresql 9.5)

I was trying to import a Postgres 9.5 dump into a Postgres 15 database and found that creating the plperl extension changes the behavior with lc_monetary: inserts with columns of type money fail when in the dump: ERROR: invalid input syntax for type…
0
votes
1 answer

restful api call using plperl language in postgresql

I have install plperl language in postgresql for the purpose of sending restful api requests to an API endpoint using a function. My function is below CREATE OR REPLACE FUNCTION sdpmtn_mt.sendnotification( ) RETURNS text LANGUAGE 'plperl' COST…
N. Felix
  • 69
  • 1
  • 10
0
votes
2 answers

CREATE LANGUAGE plperlu; fails despite postgresql-plperl-12 being installed

I'm on an Ubuntu-derived system (specifically pop_os from System76). I am trying to get Bucardo installed, but it appears to be failing because plperlu is not functional. In a psql prompt: # CREATE LANGUAGE plperlu; ERROR: could not access file…
David
  • 187
  • 7
0
votes
1 answer

How can i Call restFull API in PostgreSQL

I am using PostgreSQL 12.6, compiled by Visual C++ build 1914, 64-bit on Windows Server. And like to know how can I call RestFull API using python or perl in postgres. I am relatively new in call restFull API from postgres so I will need a step by…
Jay Mehta
  • 13
  • 3