简体   繁体   English

安装PostgreSQL 9.0后如何更改NAMEDATALEN配置?

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

I'm supporting some legacy PostgreSQL 8.3/4 databases, and migrating them onto some newer Windows Server 2008 hardware. 我支持一些传统的PostgreSQL 8.3 / 4数据库,并将它们迁移到一些较新的Windows Server 2008硬件上。

I've been informed that the NAMEDATALEN figure needs to be higher than the default. 我被告知NAMEDATALEN数字需要高于默认值。

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. 据我所知,配置文件中不存在NAMEDATALEN配置,而是需要在编译应用程序时设置。

Having already installed PostgreSQL 9.0 on the new box, I'm wondering if it's possible to alter this configuration after the fact? 已经在新盒子上安装了PostgreSQL 9.0,我想知道是否有可能在事后改变这种配置?

It's not possible to alter this option - it needs to be changed in source file src/include/pg_config_manual.h . 无法更改此选项 - 需要在源文件src/include/pg_config_manual.h更改它。 Then Postgres needs to be recompiled, data directory initialized with initdb and data restored. 然后需要重新编译Postgres,使用initdb初始化数据目录并恢复数据。 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. 修补应用程序源以使用较短的表/函数/ etc名称更加容易和明智。 The maximum is 63 characters, which is enough for insanely_stupid_and_totally_impractical_table_or_function_name0 最大值为63个字符,足以满足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 . 这个问题应该可以迁移到serverfault.com

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM