- Home
- Tag: Perl
Posts tagged Perl
Tag: Perl
Luca Ferrari: Perl code reuse in Pl/Perl thru pg_proc and anonymous code blocks
Feed: Planet PostgreSQL. PostgreSQL allows you to write executable code, e.g., FUNCTIONs and PROCEDUREs in Perl thru its extension language Pl/Perl (plperl and plperlu). But sometimes there is the need to use the same Perl block over and over again across different code blocks and functions. There are different approaches, most notably the module one: abstract your behavior into a module and load it whenever you need. Yeah, this means using plperlu, but it is a fair tradeoff. However, keeping in mind how PostgreSQL stores procedures and their code, it is possible to use a more fancy approach. In this ... Read More
Luca Ferrari: Pl/Perl Recursion
Feed: Planet PostgreSQL. While solving the Perl Weekly Challenge 154, I provided a couple of possible solutions in Pl/Perl, the widely available Perl integration within PostgreSQL. One task to solve, Padovan numbers, required to use recursion, and that is something not as simple as it could seem to implement using Pl/Perl. Why? Because Pl/Perl does not expose Perl objects, rather is a way to execute Perl within SQL objects (e.g., functions). What it means is that SQL objects are (clearly) the first class objects available, so you have always to use SQL functions to recurse. Except when you don’t want ... Read More
Luca Ferrari: Perl Weekly Challenge 153: recursive CTEs

Feed: Planet PostgreSQL. This is a short tour about my solutions to the Challenge 153 done in PostgreSQL. PWC 153 - Task 1 This task was about producing left factorial numbers, where each value is computed by summing all the previously computed factorials. I decided to implement it on top of a recursive CTE named factorials that, well, computes factorials. That was the easy part, then I needed to compute the sum of all the values less than the current one. Let’s use a LATERAL JOIN for the task: with recursive factorials as ( SELECT 0::numeric as num ,1::numeric as ... Read More
Luca Ferrari: Perl Weekly Challenge 136: PostgreSQL Solutions
Feed: Planet PostgreSQL. Wait a minute, what the hell is going on? A Perl challenge and PostgreSQL? Well, it is almost two years now since I’ve started participating regurarly in the Perl Weekly Challenge, and I always solve the tasks in Raku (aka Perl 6). Today I decided to spend a few minutes in order to try to solve the assigned tasks in PostgreSQL. And I tried to solve them in an SQL way: declaratively. So here there are my solutions in PostgreSQL for the Challenge 136. PWC 136 - Task 1 The first task asked to find out if ... Read More
Luca Ferrari: Preventing FreeBSD to kill PostgreSQL (aka OOM Killer prevention)
Feed: Planet PostgreSQL. There are a lot of interesting articles on how to prevent the Out of Memory Killer (OOM killer in short) on Linux to ruin you day, or better your night. One particular well done explaination about how the OOM Killer works, and how to help PostgreSQL to survive, is, in my humble opinion, the one from Percona Blog. I tend to run PostgreSQL on FreeBSD machines, at least whenever it is possible, and quite frankly I have still a lot of things to learn. One of those little details is about FreeBSD OOM Killer. It turned out ... Read More
Luca Ferrari: A glance at Raku connectivity towards PostgreSQL
Feed: Planet PostgreSQL. Raku is a great language in my opinion, and I’m using it more and more everyday. I can say it is going to substitute my Perl scripting. Raku comes with an extensive module library, that include of course database connectivity, that in turn includes features for connecting to PostgreSQL. In this simple article, I’m going to quickly demonstrate how to use a Raku piece of code to do many of the trivial tasks than a database application can do. The script is presented in an incremental way, so the Connecting to the database section must be always ... Read More
What should Java developers learn in 2021?
Feed: Featured Blog Posts - Data Science Central. Author: OLIVIA CUTHBERT. If you want to work effectively on Java projects as a developer in this competitive world, there are many things you should learn. You must have many skills, and what you should have depends on the position you. But according to the latest survey on Java programmer skills and the current market demand, here we will discuss the top 10 things a Java programmer should learn in 2021. Essential skills for Java programmers Are you a Java programmer or a working professional looking to switch to Java? Or are ... Read More
Is a Session Analyzer a Good Tool to Simulate Real Traffic?

Feed: Planet MySQL; Author: MySQL Performance Blog; Starting a long time ago, we wanted to reproduce workload in a non-production environment, and there were different attempts to achieve that goal (Query Playback is just one of them). But there is another point of view, where you need to write your own workload to do so. Both Have Pros and Cons Reproduce Workload: Pros: Simple to implement Ready to go Cons: Need to rebuild the environment each time Custom Scripts: Pros: Possible to have a more realistic workload You can reuse the environment You can use Sysbench that allows you to ... Read More
Joe Conway: Musings of a PostgreSQL Data Pontiff Episode 1
Feed: Planet PostgreSQL. Introduction to a PostgreSQL "Data Science" Blog SeriesThis is the first in a series of blogs on the topic of using PostgreSQL for "data science". I put that in quotes because I would not consider myself to be a practicing data scientist, per se. Of course I'm not sure there is a universally accepted definition of data scientist. This article provides a nice illustration of my point ... Read More
Enable resilience and accelerate growth with your Azure migration
Feed: Microsoft Azure Blog. Author: Jeremy Winter. In response to the global health and macroeconomic crisis that began last year, customers have been accelerating their digital transformation efforts at an unprecedented pace to help bolster organizational resilience. They have depended on the cloud to not only help maintain business continuity throughout the recovery but also reimagine their mission for long-term growth. Customers like Albertsons Companies, Actavo, H&R Block, and Additiv have shared how migrating to the cloud with Microsoft Azure allowed them to stay resilient: "Within the space of a week, we were able to tick a box that said, 'If lockdown ... Read More
Recent Comments