Instructions for increasing the maximum number of columns in PostgreSQL on Linux

This is a draft guide with instructions for increasing the maximum number of columns in PostgreSQL 9.3 on Linux. (see also General FAQ )

Tested in August 2014 on Kubuntu 14.04, 64 bits.

I wrote a patch and a detailed compilation set of instructions to increase the number of columns in postgresql to possibly several thousand columns. I did a few tests, then a set of 136 automated tests and got 3 warnings. I described that here, on the pgsql-hackers mailing list, here:

http://www.postgresql.org/message-id/53F4C11C.5030809@free.fr

A core postgresql developer answered that the first two warnings are no big deal (change in the query plan, not the function), the third one shows that the test is brittle, not the compiled binary:

http://www.postgresql.org/message-id/25156.1408555042@sss.pgh.pa.us

Still, postgresql 136 tests are not a comprehensive test set (such a set does not exist...). And I have not tried to run LimeSurvey on this.

Hence this must be used with a lot of care (not in a production environment without more testing). But it looks quite promising.

The full discussion on postgresql forum is here:

http://www.postgresql.org/search/?m=1&q=patching+for+increasing+the+number+of+columns+Mayeul&l=1&d=-1&s=d

The code and instructions follow (note that some of the code below is NOT bash code; and some lines starting with # are not comments):

Below a few sql commands, for testing:

We insert a 2000-field tuple in the t_2001 table.

Testing joins:

-