Thread: local_preload_libraries filenames converted to lowercase
Severity: minor Tested On: 9.0b2, 8.4.4 Platform: SUN SPARC 4u Enterprise 450 Quad, presumably Solaris 10 Repeatable? Yes Description: See thread: http://archives.postgresql.org/pgsql-testers/2010-06/msg00020.php -- -- Josh Berkus PostgreSQL Experts Inc. http://www.pgexperts.com
Josh Berkus <josh@agliodbs.com> writes: > http://archives.postgresql.org/pgsql-testers/2010-06/msg00020.php We'd need to see exactly how local_preload_libraries is being set. regards, tom lane
Josh Berkus <josh@agliodbs.com> writes: > http://archives.postgresql.org/pgsql-testers/2010-06/msg00020.php OK, I looked at this a bit, and the answer is that load_libraries uses SplitIdentifierString, ie, it thinks the value of the variable is a list of comma-separated SQL identifiers. So if you want a filename containing upper case, whitespace, or commas, double-quote it. That might seem a bit bizarre, but because of the special meaning of commas we'd need some quoting rule anyhow. I'm not sure it's worth making local_preload_libraries have its own private parsing convention. Perhaps this is just a documentation deficiency. regards, tom lane
> That might seem a bit bizarre, but because of the special meaning of > commas we'd need some quoting rule anyhow. I'm not sure it's worth > making local_preload_libraries have its own private parsing convention. > Perhaps this is just a documentation deficiency. Yes, I'd say that documentation is the answer, given. Hmmm .... are double-quotes respected in postgresql.conf, though? Need testing. -- -- Josh Berkus PostgreSQL Experts Inc. http://www.pgexperts.com
Josh Berkus <josh@agliodbs.com> writes: > Yes, I'd say that documentation is the answer, given. Hmmm .... are > double-quotes respected in postgresql.conf, though? Need testing. Not sure. Something like local_preload_libraries = '"Foo", "Bar"' will definitely work. Don't know if you can dispense with the outer single quotes. regards, tom lane
Tom Lane wrote: > Josh Berkus <josh@agliodbs.com> writes: > > Yes, I'd say that documentation is the answer, given. Hmmm .... are > > double-quotes respected in postgresql.conf, though? Need testing. > > Not sure. Something like > > local_preload_libraries = '"Foo", "Bar"' > > will definitely work. Don't know if you can dispense with the outer > single quotes. I have documented the requirement for double quotes; attached patch applied. -- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com + None of us is going to be here forever. + Index: doc/src/sgml/config.sgml =================================================================== RCS file: /cvsroot/pgsql/doc/src/sgml/config.sgml,v retrieving revision 1.285 diff -c -c -r1.285 config.sgml *** doc/src/sgml/config.sgml 28 Jun 2010 22:46:11 -0000 1.285 --- doc/src/sgml/config.sgml 29 Jun 2010 22:17:58 -0000 *************** *** 1015,1020 **** --- 1015,1021 ---- <literal>mylib.so</> (or on some platforms, <literal>mylib.sl</>) to be preloaded from the installation's standard library directory. + All library names are converted to lowercase unless double-quoted. If more than one library is to be loaded, separate their names with commas. This parameter can only be set at server start. </para> *************** *** 4838,4844 **** <para> This variable specifies one or more shared libraries that are to be preloaded at connection start. If more than one library ! is to be loaded, separate their names with commas. This parameter cannot be changed after the start of a particular session. </para> --- 4839,4846 ---- <para> This variable specifies one or more shared libraries that are to be preloaded at connection start. If more than one library ! is to be loaded, separate their names with commas. All library ! names are converted to lowercase unless double-quoted. This parameter cannot be changed after the start of a particular session. </para>