Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I change the NAMEDATALEN configuration after installing PostgreSQL 9.0?

Tags:

postgresql

I'm supporting some legacy PostgreSQL 8.3/4 databases, and migrating them onto some newer Windows Server 2008 hardware.

I've been informed that the NAMEDATALEN figure needs to be higher than the default.

As far as I understand, the NAMEDATALEN configuration does not exist in a config file, but rather needs to be set on compiling the application.

Having already installed PostgreSQL 9.0 on the new box, I'm wondering if it's possible to alter this configuration after the fact?

like image 422
Scott Herbert Avatar asked Oct 01 '10 02:10

Scott Herbert


People also ask

Which of the following command is used to set the runtime configurations?

The commands ALTER USER and ALTER DATABASE, respectively, are used to configure these settings.

What is the default block size in PostgreSQL?

The default block size is 8192 bytes, hence the default limit was 32TB as listed.

What is option in PSQL?

psql can be told about those parameters via command line options, namely -d , -h , -p , and -U respectively. If an argument is found that does not belong to any option it will be interpreted as the database name (or the user name, if the database name is already given).

What is Max_wal_size?

So what is max_wal_size? The max_wal_size parameter tells PostgreSQL what the approximate maximum total size of the stored WAL segments should be. Once the allowed space is exhausted, a checkpoint is requested so that the space can be recycled.


1 Answers

It's not possible to alter this option - it needs to be changed in source file src/include/pg_config_manual.h. Then Postgres needs to be recompiled, data directory initialized with initdb and data restored. Every security and bugfix minor release will then have to be patched and recompiled. This is bad thing to do.

This is much easier and sensible to patch an application source to use shorter table/function/etc names. The maximum is 63 characters, which is enough for insanely_stupid_and_totally_impractical_table_or_function_name0

Maybe your schema really does not need longer names, and this requirement it is just an artifact from long gone version of your client application. Check this - try to import a schema and functions to new database.

And this question should probably be migrated to serverfault.com.

like image 59
Tometzky Avatar answered Oct 02 '22 14:10

Tometzky