[pi-code-cleaning] The to_date function newly added and modified
authorNaroa Iriarte <naroa.iriarte@openbravo.com>
Wed, 27 Apr 2016 14:44:37 +0200
changeset 29517 9f7d593832a5
parent 29516 05b62a860514
child 29518 bd9bd3be41a7
[pi-code-cleaning] The to_date function newly added and modified

The previously deleted to_date function, has been newly added and
modified to get a charater argument instead of a timestam argument in the
to_timestamp function invocation.
src-db/database/model/prescript-PostgreSql.sql
--- a/src-db/database/model/prescript-PostgreSql.sql	Tue Apr 26 17:15:29 2016 +0200
+++ b/src-db/database/model/prescript-PostgreSql.sql	Wed Apr 27 14:44:37 2016 +0200
@@ -261,6 +261,17 @@
 ' LANGUAGE 'plpgsql' IMMUTABLE
 /-- END
 
+CREATE OR REPLACE FUNCTION to_date
+(
+ timestamp, varchar
+)
+  RETURNS timestamp AS '
+BEGIN
+  RETURN to_timestamp(to_char($1), $2);
+END;
+' LANGUAGE 'plpgsql' IMMUTABLE
+/-- END
+
 CREATE OR REPLACE FUNCTION to_timestamp
 (
  timestamptz