Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Jan 2006 09:06:11 GMT
From:      Victor Snezhko <snezhko@indorsoft.ru>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/92594: [patch] postgresql81-server startup script can't set default database encoding in initdb
Message-ID:  <200601310906.k0V96BrS037253@www.freebsd.org>
Resent-Message-ID: <200601310910.k0V9A5cU039363@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         92594
>Category:       ports
>Synopsis:       [patch] postgresql81-server startup script can't set default database encoding in initdb
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 31 09:10:02 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Victor Snezhko
>Release:        6.0-RELEASE
>Organization:
IndorSoft Ltd.
>Environment:
FreeBSD  6.0-RELEASE-p4 FreeBSD 6.0-RELEASE-p4 #2: Sat Jan 28 10:06:27 NOVT 2006     root@:/usr/obj/usr/src/sys/VVS  i386
       
>Description:
There is no clean way to supply -E (default database encoding) option to initdb.
For now it's only possible to modify a startup script.
>How-To-Repeat:
install postgresql81-server     
>Fix:
I suggest adding an option 'postgresql_initdb_encoding'.

Here is the patch against postgresql81-server:

--- 010.pgsql.sh.orig   Tue Jan 31 21:02:49 2006
+++ 010.pgsql.sh        Tue Jan 31 21:22:55 2006
@@ -12,6 +12,7 @@
 #  # optional
 #  postgresql_data="/usr/local/pgsql/data"
 #  postgresql_flags="-w -s -m fast"
+#  postgresql_initdb_encoding="UTF8"
 #
 # This scripts takes one of the following commands:
 #
@@ -28,6 +29,7 @@
 # set defaults
 postgresql_enable=${postgresql_enable:-"NO"}
 postgresql_flags=${postgresql_flags:-"-w -s -m fast"}
+postgresql_initdb_encoding=${postgresql_initdb_encoding:-"SQL_ASCII"}
 postgresql_user=pgsql
 eval postgresql_data=${postgresql_data:-"~${postgresql_user}/data"}
 postgresql_class=${postgresql_class:-"default"}
@@ -53,7 +55,7 @@

 postgresql_initdb()
 {
-    su -l -c ${postgresql_class} ${postgresql_user} -c "exec ${prefix}/bin/initdb -D ${postgresql_data}"
+    su -l -c ${postgresql_class} ${postgresql_user} -c "exec ${prefix}/bin/initdb -D ${postgresql_data} -E ${postgresql_initdb_encoding}"
 }

 run_rc_command "$1"

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200601310906.k0V96BrS037253>