Comment 2 for bug 1307265

Revision history for this message
Ubfan (ubfan1) wrote :

The Postgresql 9.3 update to Ubuntu 14.04 improperly changed the default port from 5432 to 5433.

Historically, port 5432 has been the default Postgresql port. Some update in 14.04 of Postgresql to 9.3.4-1 apparently decided to use 5433 as the default port. This change breaks things because header files like postgresql.conf have the default,5432, wired into them as both strings and numbers, so while psql will work on the new default port, existing compiled programs using
ecpg preprocessing fail and recompiling/reinking does not fix the problem either (because of the header files with the old default).
(Assuming everything was using the default, when no PGPORT environment variable has been explicitly set).

If you are going to change the port default, you have to do a complete job of altering all the header files, and at least warn users that the new Postgresql upgrade may require a recompile/relink of existing programs.

  A workaround to the ecpg programs (and anything else relying on the headers) is to explicitly set the environment variable PGPORT to 5433, just as if a non-default port is being used. The whole point of a default is that's what you get when you don't specify anything. A better workaround is to edit the 5433 back to 5432 in the postgresql.conf file, and restart.

The suggested fix is to NOT change the default port from 5432 in the first place.