20 Mar 2011

Arrays in PostgreSQL quick example

What is an array in database?

PostgreSQL allows columns of a table to be defined as variable-length multidimensional arrays. Arrays of any built-in or user-defined base type, enum type, or composite type can be created. Arrays are not supper efficient way of doing things, but they are sometimes handy.

Create some test data

Suppose we have table like this:

CREATE TABLE survey_test (
 id SERIAL,
 gender CHAR(1),
 school CHAR(2), -- can be: LO, TH, ZW
 q_9 VARCHAR(10) -- can be: [A-J]{0,10}
);

Where we store this data:

Securing Linux: few tips for good configuration of SSHD

Most people install sshd daemon using command apt-get install open-sshd, and then forgets about making it more secure. In this article I will point out few sshd options which you should have in your sshd config when going to production.