Tag

perl Archives - AWS Managed Services by Anchor

Extending PostgreSQL with high level languages (and cats)

By | Technical | No Comments

In a recent post we extolled the virtues of creating your own brand new operators in PostgreSQL. SELECT =^_^= FROM happycats; That’s well and good, but the output was a little lacklustre, returning “meow” for every tuple. We’d like to make it more interesting, and one way to add interesting functionality to Postgres is to embed a procedural language. This lets you juggle data with a little more finesse when it comes to certain operations, compared to the usual relational algebra. We’re going to use Perl because it’s easy to integrate with Postgres, and is generally a quick and dirty way to Get Stuff Done. When embedded in Postgres it’s referred to as PL/Perl. Let’s get started. We begin by “installing” the language into the database in which we wish…

Read More

The long running process dilemma

By | Technical | No Comments

Recently we had a client on one of our webservers doing something which we consider to be bad form, inconsiderate and downright annoying – running scripts from cron every five minutes which take longer than five minutes to run. The end result? Processes that pile up, consuming resources and frequently inconveniencing other customers (if it is running on a shared webserver). If the scripts in question are competing for resources, you can frequently end up in a dead-lock or live-lock situation as well. It seems some developers are blissfully unaware of how to write their scripts with enough safety features built in. Fortunately, we at Anchor have encountered these situations enough times to know how to best combat them. In this scenario our client was using Perl in scripts which…

Read More