Index: openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/Attic/00-database-procs.tcl,v diff -u -r1.42 -r1.43 --- openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl 21 Oct 2003 22:35:24 -0000 1.42 +++ openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl 31 Oct 2003 16:11:25 -0000 1.43 @@ -2457,15 +2457,19 @@ } set fd [open $file r] - set copy_command [subst [read $fd]] + set copy_command [subst -nobackslashes [read $fd]] close $fd - + set copy_file [ns_mktemp /tmp/psql-copyfile-XXXXXX] + set fd [open $copy_file "CREAT EXCL WRONLY" 0600] + puts $fd $copy_command + close $fd + if { $tcl_platform(platform) == "windows" } { - set fp [open "|[file join [db_get_pgbin] psql] -c \"$copy_command\" -h [ns_info hostname] $pgport $pguser [db_get_database]" "r"] + set fp [open "|[file join [db_get_pgbin] psql] -f $copy_file -h [ns_info hostname] $pgport $pguser [db_get_database]" "r"] } else { - set fp [open "|[file join [db_get_pgbin] psql] -c \"$copy_command\" $pghost $pgport $pguser [db_get_database] $pgpass" "r"] + set fp [open "|[file join [db_get_pgbin] psql] -f $copy_file $pghost $pgport $pguser [db_get_database] $pgpass" "r"] } - + while { [gets $fp line] >= 0 } { # Don't bother writing out lines which are purely whitespace. if { ![string is space $line] } { @@ -2481,6 +2485,9 @@ close $fp } error] + # remove the copy file. + file delete -force $copy_file + if { $errno == 2 } { return $error } @@ -2911,7 +2918,7 @@ } } - ns_log Notice "$proc_name: atp: $which_proc -ulevel [expr {$ulevel +1}] $type $db $statement_name $pre_sql $file" + ns_log Debug "$proc_name: $which_proc -ulevel [expr {$ulevel +1}] $type $db $statement_name $pre_sql $file" return [$which_proc -ulevel [expr {$ulevel +1}] $type $db $statement_name $pre_sql $file] } Index: openacs-4/packages/ref-countries/sql/postgresql/00-countries.ctl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ref-countries/sql/postgresql/00-countries.ctl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/ref-countries/sql/postgresql/00-countries.ctl 3 Oct 2003 10:11:57 -0000 1.2 +++ openacs-4/packages/ref-countries/sql/postgresql/00-countries.ctl 31 Oct 2003 16:11:24 -0000 1.3 @@ -1,3 +1 @@ -copy countries from '[acs_root_dir]/packages/ref-countries/sql/common/countries.dat' -[ad_decode [db_version] "7.2" "delimiters" "delimiter"] ';' -[ad_decode [db_version] "7.2" "with null as" "null"] '' +\copy countries from '[acs_root_dir]/packages/ref-countries/sql/common/countries.dat' [ad_decode [db_version] "7.2" "delimiters" "delimiter"] ';' [ad_decode [db_version] "7.2" "with null as" "null"] '' Index: openacs-4/packages/ref-currency/sql/postgresql/00-currencies.ctl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ref-currency/sql/postgresql/00-currencies.ctl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/ref-currency/sql/postgresql/00-currencies.ctl 3 Oct 2003 10:11:58 -0000 1.2 +++ openacs-4/packages/ref-currency/sql/postgresql/00-currencies.ctl 31 Oct 2003 16:11:24 -0000 1.3 @@ -1,3 +1 @@ -copy currencies from '[acs_root_dir]/packages/ref-currency/sql/common/currencies.dat' -[ad_decode [db_version] "7.2" "delimiters" "delimiter"] ',' -[ad_decode [db_version] "7.2" "with null as" "null"] '' +\copy currencies from '[acs_root_dir]/packages/ref-currency/sql/common/currencies.dat' [ad_decode [db_version] "7.2" "delimiters" "delimiter"] ',' [ad_decode [db_version] "7.2" "with null as" "null"] '' Index: openacs-4/packages/ref-language/sql/postgresql/00-languages.ctl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ref-language/sql/postgresql/00-languages.ctl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/ref-language/sql/postgresql/00-languages.ctl 3 Oct 2003 10:11:58 -0000 1.2 +++ openacs-4/packages/ref-language/sql/postgresql/00-languages.ctl 31 Oct 2003 16:11:24 -0000 1.3 @@ -1,3 +1 @@ -copy language_codes from '[acs_root_dir]/packages/ref-language/sql/common/languages.dat' -[ad_decode [db_version] "7.2" "delimiters" "delimiter"] ',' -[ad_decode [db_version] "7.2" "with null as" "null"] '' +\copy language_codes from '[acs_root_dir]/packages/ref-language/sql/common/languages.dat' [ad_decode [db_version] "7.2" "delimiters" "delimiter"] ',' [ad_decode [db_version] "7.2" "with null as" "null"] '' Index: openacs-4/packages/ref-timezones/sql/postgresql/00-timezones.ctl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ref-timezones/sql/postgresql/00-timezones.ctl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/ref-timezones/sql/postgresql/00-timezones.ctl 3 Oct 2003 10:11:58 -0000 1.4 +++ openacs-4/packages/ref-timezones/sql/postgresql/00-timezones.ctl 31 Oct 2003 16:11:25 -0000 1.5 @@ -1,3 +1 @@ -copy timezones from '[acs_root_dir]/packages/ref-timezones/sql/common/timezones.dat' -[ad_decode [db_version] "7.2" "delimiters" "delimiter"] ',' -[ad_decode [db_version] "7.2" "with null as" "null"] '' +\copy timezones from '[acs_root_dir]/packages/ref-timezones/sql/common/timezones.dat' [ad_decode [db_version] "7.2" "delimiters" "delimiter"] ',' [ad_decode [db_version] "7.2" "with null as" "null"] '' Index: openacs-4/packages/ref-timezones/sql/postgresql/01-timezone-rules.ctl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ref-timezones/sql/postgresql/01-timezone-rules.ctl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/ref-timezones/sql/postgresql/01-timezone-rules.ctl 2 Sep 2003 15:27:37 -0000 1.4 +++ openacs-4/packages/ref-timezones/sql/postgresql/01-timezone-rules.ctl 31 Oct 2003 16:11:25 -0000 1.5 @@ -1,4 +1 @@ -copy timezone_rules -from '[acs_root_dir]/packages/ref-timezones/sql/common/timezone-rules.dat' -[ad_decode [db_version] "7.2" "delimiters" "delimiter"] ',' -[ad_decode [db_version] "7.2" "with null as" "null"] '' +\copy timezone_rules from '[acs_root_dir]/packages/ref-timezones/sql/common/timezone-rules.dat' [ad_decode [db_version] "7.2" "delimiters" "delimiter"] ',' [ad_decode [db_version] "7.2" "with null as" "null"] '' Index: openacs-4/packages/ref-us-counties/sql/postgresql/00-us-counties.ctl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ref-us-counties/sql/postgresql/00-us-counties.ctl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/ref-us-counties/sql/postgresql/00-us-counties.ctl 3 Oct 2003 10:11:58 -0000 1.2 +++ openacs-4/packages/ref-us-counties/sql/postgresql/00-us-counties.ctl 31 Oct 2003 16:11:25 -0000 1.3 @@ -1,3 +1 @@ -copy us_counties from '[acs_root_dir]/packages/ref-us-counties/sql/common/us-counties.dat' -[ad_decode [db_version] "7.2" "delimiters" "delimiter"] ',' -[ad_decode [db_version] "7.2" "with null as" "null"] '' +\copy us_counties from '[acs_root_dir]/packages/ref-us-counties/sql/common/us-counties.dat' [ad_decode [db_version] "7.2" "delimiters" "delimiter"] ',' [ad_decode [db_version] "7.2" "with null as" "null"] '' Index: openacs-4/packages/ref-us-states/sql/postgresql/00-us-states.ctl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ref-us-states/sql/postgresql/00-us-states.ctl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/ref-us-states/sql/postgresql/00-us-states.ctl 3 Oct 2003 10:11:58 -0000 1.2 +++ openacs-4/packages/ref-us-states/sql/postgresql/00-us-states.ctl 31 Oct 2003 16:11:25 -0000 1.3 @@ -1,3 +1 @@ -copy us_states from '[acs_root_dir]/packages/ref-us-states/sql/common/us-states.dat' -[ad_decode [db_version] "7.2" "delimiters" "delimiter"] ',' -[ad_decode [db_version] "7.2" "with null as" "null"] '' +\copy us_states from '[acs_root_dir]/packages/ref-us-states/sql/common/us-states.dat' [ad_decode [db_version] "7.2" "delimiters" "delimiter"] ',' [ad_decode [db_version] "7.2" "with null as" "null"] '' Index: openacs-4/packages/ref-us-zipcodes/sql/postgresql/00-us-zipcodes.ctl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ref-us-zipcodes/sql/postgresql/00-us-zipcodes.ctl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/ref-us-zipcodes/sql/postgresql/00-us-zipcodes.ctl 3 Oct 2003 10:11:58 -0000 1.2 +++ openacs-4/packages/ref-us-zipcodes/sql/postgresql/00-us-zipcodes.ctl 31 Oct 2003 16:11:25 -0000 1.3 @@ -1,3 +1 @@ -copy us_zipcodes from '[acs_root_dir]/packages/ref-us-zipcodes/sql/common/us-zipcodes.dat' -[ad_decode [db_version] "7.2" "delimiters" "delimiter"] ',' -[ad_decode [db_version] "7.2" "with null as" "null"] '' +\copy us_zipcodes from '[acs_root_dir]/packages/ref-us-zipcodes/sql/common/us-zipcodes.dat' [ad_decode [db_version] "7.2" "delimiters" "delimiter"] ',' [ad_decode [db_version] "7.2" "with null as" "null"] ''