From ded3641914702ae00bb500507407e830f590b184 Mon Sep 17 00:00:00 2001 From: rich Date: Mon, 11 Sep 2006 09:58:43 +0000 Subject: [PATCH] Copy the database rows in the same order as the original database. --- tools/copy_host.ml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/copy_host.ml b/tools/copy_host.ml index aef72a9..e1e0a0b 100644 --- a/tools/copy_host.ml +++ b/tools/copy_host.ml @@ -3,7 +3,7 @@ * * Use 'copy_host --help' for usage. * - * $Id: copy_host.ml,v 1.1 2006/09/09 15:08:08 rich Exp $ + * $Id: copy_host.ml,v 1.2 2006/09/11 09:58:43 rich Exp $ *) open Printf @@ -179,7 +179,7 @@ let dryrun = !dryrun (* Get column names from a table. *) let columns dbh table_name = - let query = "select * from " ^ table_name in + let query = "select * from " ^ table_name ^ " order by 1" in let name = "columns" in PGOCaml.prepare dbh ~query ~name (); let columns = @@ -195,7 +195,8 @@ let select_all dbh table_name where_clause = let query = "select * from " ^ table_name ^ (match where_clause with | "" -> "" - | where_clause -> " where " ^ where_clause) in + | where_clause -> " where " ^ where_clause) ^ + " order by 1" in let name = "selectall" in PGOCaml.prepare dbh ~query ~name (); let columns = -- 1.8.3.1