Relative Content

Postgresql

category

Securing Postgresql

In an ideal world Postgresql ports would not be open to the internet however it is never a bad idea to add a layer of security.  If you do have public facing postgresql ports then it is essential. For this tutorial I have written a couple of script to help with creating a Certificate authority […]

Postgresql replication

PREAMBLE It goes without saying that if you want to set up replication then you need a master and a slave postgresql server.  There is a bit of configuration to do in order to get it running. This how to was originally written for older versions of Postgresql but has been updated to reflect the […]

Postgresql

As it does; Debian will bastardise the installation of postgresql in the usual manner, but it does offer a reasonable way to remove the bastardisation and configure it yourself so that you can have the data directory exactly where you want it. The idea behind having a separate logical volume for the data is that […]

Using PQexecparams with a char** array

In short, if you are creating an array of arguments to pass to PQexecparams() (i.e. char**) then you need to leave enough space to null terminate the array. Many C programs use a while loop to iterate through an array until they find a null pointer i.e. while (*argv) { //foo ++argv; }   As […]

Postgresql Time (epoch)

In addition to standard timestamps we can also ask postgres to return the number of seconds from the epoch.  To the uninitiated the epoch is usually the number of seconds past a fixed point in time (usually, but not always, midnight on 01/01/1970).  If you would like to know when the epoch is on your […]

SQL Time stamps

Throughout my program I use time stamps all over the place for all sorts of different purposes in all sorts of different formats.  This post is to give you an overview of the basics.  There is no C++ or Ncurses code here, any of the code is commands that can be typed at a psql […]