diff -ruN postgresql-7.4.13-old/doc/src/sgml/ref/initdb.sgml postgresql-7.4.13/doc/src/sgml/ref/initdb.sgml
--- postgresql-7.4.13-old/doc/src/sgml/ref/initdb.sgml	2003-08-31 19:32:23.000000000 +0200
+++ postgresql-7.4.13/doc/src/sgml/ref/initdb.sgml	2004-01-07 12:07:35.000000000 +0100
@@ -227,6 +227,24 @@
        </para>
       </listitem>
      </varlistentry>
+
+     <varlistentry>
+      <term><option>--debian-conffile</option></term>
+      <listitem>
+       <para>
+        On Debian systems, this option is used by the package's
+	post-initialisation script when it runs <command>initdb</command> to
+	create a database.
+        It symlinks the configuration files into the <filename>/etc/postgresql</filename>
+        directory, whereas the standard behaviour is to put these files
+        into the database directory.
+       </para>
+       <para>
+        This option disables that behaviour, thus causing <command>initdb</command>
+        to behave as expected.
+       </para>
+      </listitem>
+     </varlistentry>
     </variablelist>
    </para>
 
diff -ruN postgresql-7.4.13-old/src/bin/initdb/initdb.sh postgresql-7.4.13/src/bin/initdb/initdb.sh
--- postgresql-7.4.13-old/src/bin/initdb/initdb.sh	2003-10-13 23:06:44.000000000 +0200
+++ postgresql-7.4.13/src/bin/initdb/initdb.sh	2004-01-07 12:16:37.000000000 +0100
@@ -71,7 +71,6 @@
     echo "$ret"
 }
 
-
 CMDNAME=`basename $0`
 
 # Placed here during build
@@ -196,6 +195,7 @@
 debug=
 noclean=
 show_setting=
+debian_conffile=
 
 # Note: There is a single compelling reason that the name of the database
 #       superuser be the same as the Unix user owning the server process:
@@ -318,6 +318,14 @@
         --lc-time=*)
                 PGLC_TIME=`echo $1 | sed 's/^[^=]*=//'`
                 ;;
+# Debian's initdb is going to try to symlink the files from $PGDATA to
+# /etc/postgres... but if you're initialising a database somewhere else,
+# you don't want this behaviour, so tell initdb to not do it.
+	--debian-conffile)
+		debian_conffile=yes
+		echo "use debian conffile location"
+		;;
+
 
 	-*)
 		echo "$CMDNAME: invalid option: $1"
@@ -590,6 +598,8 @@
 #
 # CREATE CONFIG FILES
 
+if [ -z "$debian_conffile" ]
+then
 $ECHO_N "creating configuration files... "$ECHO_C
 
 sed -e "s/^#shared_buffers = 1000/shared_buffers = $nbuffers/" \
@@ -611,6 +621,32 @@
 chmod 0600 "$PGDATA"/pg_hba.conf "$PGDATA"/pg_ident.conf \
 	"$PGDATA"/postgresql.conf
 
+else
+
+# debian-conffile option set:
+# In a Debian primary installation, the config files go to /etc/postgresql/
+# rather than to $PGDATA.
+ln -sf /etc/postgresql/pg_hba.conf $PGDATA/pg_hba.conf          || exit_nicely
+ln -sf /etc/postgresql/pg_ident.conf $PGDATA/pg_ident.conf      || exit_nicely
+ln -sf /etc/postgresql/postgresql.conf $PGDATA/postgresql.conf  || exit_nicely
+
+# Since postgresql.conf is a permanent file, rather than created with the
+# database, it must have the LC_ values replaced rather than just tacked
+# on the end.
+(
+  grep -vE '^LC_(MESSAGES|MONETARY|NUMERIC|TIME) *=' /etc/postgresql/postgresql.conf
+  for cat in MESSAGES MONETARY NUMERIC TIME; do
+    echo "LC_$cat = '`pg_getlocale $cat`'"
+  done
+) >/etc/postgresql/$$ || exit_nicely
+cat /etc/postgresql/$$ >/etc/postgresql/postgresql.conf || exit_nicely
+rm /etc/postgresql/$$
+
+chmod 0600 /etc/postgresql/pg_hba.conf /etc/postgresql/pg_ident.conf
+chmod 0644 /etc/postgresql/postgresql.conf
+
+fi
+
 echo "ok"
 
 ##########################################################################
@@ -1143,13 +1179,9 @@
 # FINISHED
 
 echo
-echo "Success. You can now start the database server using:"
-echo ""
-echo "    $PGPATH/postmaster -D $PGDATA"
-echo "or"
-# (Advertise -l option here, otherwise we have a background
-#  process writing to the terminal.)
-echo "    $PGPATH/pg_ctl -D $PGDATA -l logfile start"
+echo "Success. The database server should be started automatically."
+echo "If not, you can start the database server using:"
 echo
+echo "    /etc/init.d/postgresql start"
 
 exit 0
