Peter Eisentraut wrote:
> Tom Lane writes:
> 
> > so it appears that cygwin's "echo" generates a different newline style
> > than what got put into sql_features.txt.  A possible way to fix this is
> > to put the "\." line into sql_features.txt, but maybe there's a cleaner
> > answer.  Peter, any thoughts?
> 
> There's no clean answer to this on Cygwin.  This specific case is just a
> little problem that we could solve locally, but in general you'll just end
> up annoying people if you require them to use consistent line endings on
> Cygwin.

Here is a little diff to make initdb behave if we decide to keep the
COPY check.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  [EMAIL PROTECTED]               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
Index: src/bin/initdb/initdb.sh
===================================================================
RCS file: /cvsroot/pgsql-server/src/bin/initdb/initdb.sh,v
retrieving revision 1.201
diff -c -c -r1.201 initdb.sh
*** src/bin/initdb/initdb.sh    7 Sep 2003 03:36:03 -0000       1.201
--- src/bin/initdb/initdb.sh    26 Sep 2003 18:23:16 -0000
***************
*** 1087,1094 ****
    echo "COPY information_schema.sql_features (feature_id, feature_name, 
sub_feature_id, sub_feature_name, is_supported, comments) FROM STDIN;"
    cat "$datadir"/sql_features.txt
    echo "\."
! ) \
!       | "$PGPATH"/postgres $PGSQL_OPT template1 > /dev/null || exit_nicely
  echo "ok"
  
  $ECHO_N "vacuuming database template1... "$ECHO_C
--- 1087,1095 ----
    echo "COPY information_schema.sql_features (feature_id, feature_name, 
sub_feature_id, sub_feature_name, is_supported, comments) FROM STDIN;"
    cat "$datadir"/sql_features.txt
    echo "\."
! ) |
! tr -d '\r' | # make newlines consistent for Win32
! "$PGPATH"/postgres $PGSQL_OPT template1 > /dev/null || exit_nicely
  echo "ok"
  
  $ECHO_N "vacuuming database template1... "$ECHO_C
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to