Update of /cvsroot/monetdb/sql/src/test/pg_regress
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv19225
Modified Files:
postgresql2sql99.sh
Log Message:
Don't do any directory stuff, act as pipe
U postgresql2sql99.sh
Index: postgresql2sql99.sh
===================================================================
RCS file: /cvsroot/monetdb/sql/src/test/pg_regress/postgresql2sql99.sh,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- postgresql2sql99.sh 7 Jan 2009 14:19:31 -0000 1.11
+++ postgresql2sql99.sh 1 Aug 2009 14:58:09 -0000 1.12
@@ -19,37 +19,27 @@
# converts PostgreSQL specific SQL into SQL99 equivalent (if possible)
-dirout="sql99"
-dirin="sql"
-# create a directory to output our converted files to
-mkdir $dirout >& /dev/null
-
-files=`cd ${dirin}; ls *.sql`
-for file in $files;
-do
- sed -r \
- -e 's/\bint8\b/bigint/ig' \
- -e 's/\bint4\b/integer/ig' \
- -e 's/\bint2\b/smallint/ig' \
- -e 's/\bfloat4\b/float/ig' \
- -e 's/\bfloat8\b/double/ig' \
- -e 's/\bpath\b/string/ig' \
- -e 's/\bpoint\b/string/ig' \
- -e 's/\bbox\b/string/ig' \
- -e 's/\bpolygon\b/string/ig' \
- -e 's/\bcity_budget\b/decimal(7,2)/ig' \
- -e 's/\bname,/string,/ig' \
- -e 's/\bname$/string/ig' \
- -e 's/(.*)\bFROM ONLY (.*)/\1 FROM \2/ig' \
- -e 's/BEGIN;/START TRANSACTION;/ig' \
- -e 's/END;/COMMIT;/ig' \
- -e 's/COMMENT.*;//ig' \
- -e 's/CREATE TABLE.*INHERITS.*;//ig' \
- -e 's/\) INHERITS.*;/\);/ig' \
- -e 's/\s+([^\s]+)::float[248]\b/ cast(\1 as double)/ig' \
- -e 's/\s+([^\s]+)::int2\b/ cast(\1 as smallint)/ig' \
- -e 's/\s+([^\s]+)::int4\b/ cast(\1 as integer)/ig' \
- -e 's/\s+([^\s]+)::int8\b/ cast(\1 as bigint)/ig' \
- -e 's/\s+([^\s]+)::(\w+(\([0-9]+(,[0-9]+))\)?)\b/ cast(\1 as
\2)/ig' \
- ${dirin}/${file} > ${dirout}/${file}
-done
+sed -r \
+ -e 's/\bint8\b/bigint/ig' \
+ -e 's/\bint4\b/integer/ig' \
+ -e 's/\bint2\b/smallint/ig' \
+ -e 's/\bfloat4\b/float/ig' \
+ -e 's/\bfloat8\b/double/ig' \
+ -e 's/\bpath\b/string/ig' \
+ -e 's/\bpoint\b/string/ig' \
+ -e 's/\bbox\b/string/ig' \
+ -e 's/\bpolygon\b/string/ig' \
+ -e 's/\bcity_budget\b/decimal(7,2)/ig' \
+ -e 's/\bname,/string,/ig' \
+ -e 's/\bname$/string/ig' \
+ -e 's/(.*)\bFROM ONLY (.*)/\1 FROM \2/ig' \
+ -e 's/BEGIN;/START TRANSACTION;/ig' \
+ -e 's/END;/COMMIT;/ig' \
+ -e 's/COMMENT.*;//ig' \
+ -e 's/CREATE TABLE.*INHERITS.*;//ig' \
+ -e 's/\) INHERITS.*;/\);/ig' \
+ -e 's/\s+([^\s]+)::float[248]\b/ cast(\1 as double)/ig' \
+ -e 's/\s+([^\s]+)::int2\b/ cast(\1 as smallint)/ig' \
+ -e 's/\s+([^\s]+)::int4\b/ cast(\1 as integer)/ig' \
+ -e 's/\s+([^\s]+)::int8\b/ cast(\1 as bigint)/ig' \
+ -e 's/\s+([^\s]+)::(\w+(\([0-9]+(,[0-9]+))\)?)\b/ cast(\1 as \2)/ig'
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins