I like to keep postgresql data and mail on completely separate independent partitions. If you are installing Debian from scratch and you use LVM with separate partitions for /home /var and /tmp (RECOMMENDED) then you can use the lvm tools to resize your /home partition to create space for /mailstore and /pgsql. If it is […]
Partitioning – The Logical Volume Manager
Formatted html – example usage (pt.3)
If you want to use this class then you will need 2 files (the header and cpp files). Please note that there is no error checking or logging in these examples and if you are using them in a production environment then you will need to add your own, but you should be able to […]
Formatted html – pretty_html (pt.2)
Once we have built our node tree we need some way to parse it in order to produce a pretty html formatted page. When I was developing this it took way to much thinking time for the number of lines of code, but there are literally 2 functions that we use, and out of them, […]
Formatted html – html_tree (pt.1)
There is a good, if somewhat basic tutorial available at tutorialspoint here: https://www.tutorialspoint.com/cplusplus/cpp_web_programming.htm so if you know nothing of using cgi then this is a good starting point. While cgicc works pretty well, debugging can be a bit of a nightmare unless you format your code to make it readable. Please note: This is reference […]
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 […]
Overloading functions when using time_t
One of the problems that we have when using postgresql is the management of time stamps. This is especially true when using PQexecparams() for reasons that I will not go in to in this post; suffice it to say that when building INSERT statements that use time stamps you may need to get creative. One […]
Recent Comments