
		-----------------------------------------
			nls_string for PostgreSQL
		-----------------------------------------

This is the INSTALL file for the nls_string collating function
for the PostgreSQL database server.

------------
Installation:

You have to compile the nls_string.c to a shared library first. Please,
check your current PostgreSQL documentation, or

  http://www.postgresql.org/docs/7.4/static/xfunc-c.html#DFUNC

for details about your platform. The command

  $ gcc -I/usr/include/pgsql/server -fPIC -shared -o nls_string.so nls_string.c

did the trick for me on a Linux machine. Please adjust the -I path
according to the path where you have PostgreSQL source code tree,
or where your PostgreSQL include files are stored (provided you do not
have the full PostgreSQL source). If you do not have the full sources
and installed PostgreSQL using some package manager (rpm, deb),
you might need package like postgresql-devel. On some systems,

  $ pg_config --includedir-server

might help you to determine location of the include fules of installed
PostgreSQL.

After you have compiled the shared library, place it to a location
close and dear to your heart. Now, in an SQL client, you have to tell
the database about the library and about the function. Run command

  create function nls_string(text, text) returns text as
	'/path/to/the/library/nls_string' language C strict ;

Adjust the path to the library to the actual location. Or use relative
path or path starting with string $libdir, if you've placed the shared
library to a well known location. Check your current PostgreSQL
documentation, or

  http://www.postgresql.org/docs/7.4/static/xfunc-c.html#XFUNC-C-DYNLOAD

for details.

After you have created the nls_string function, try it using some
selects with order by clause. Enjoy and be happy that you can sort
your data in PostgreSQL with any locale you want, without much hassle. 

---------
Available:

  http://www.fi.muni.cz/~adelton/l10n/

------
Author:

Copyright: (c) 2004 Jan Pazdziora, adelton@fi.muni.cz. All rights
reserved. Permission to use, distribute, modify, an copy this
software and this documentation for any purpose is hereby granted.

Contributors:

	Karel Zak <zakkr@zff.jcu.cz>
	ftp://ftp2.zf.jcu.cz/users/zakkr/pg/
