[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[3857] trunk/sql/modules/Util.sql



Revision: 3857
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3857&view=rev
Author:   einhverfr
Date:     2011-10-13 20:13:23 +0000 (Thu, 13 Oct 2011)
Log Message:
-----------
Adding sql function to cast input as sql date, to give us full access to the richness of PostgreSQL's date input parsing

Modified Paths:
--------------
    trunk/sql/modules/Util.sql

Modified: trunk/sql/modules/Util.sql
===================================================================
--- trunk/sql/modules/Util.sql	2011-10-13 20:07:59 UTC (rev 3856)
+++ trunk/sql/modules/Util.sql	2011-10-13 20:13:23 UTC (rev 3857)
@@ -1,3 +1,9 @@
+CREATE OR REPLACE FUNCTION parse_date(in_date date) returns date AS
+$$ select $1; $$ language sql;
+
+COMMENT ON FUNCTION parse_date IS $$ Simple way to cast a Perl string to a
+date format of known type. $$;
+
 CREATE OR REPLACE FUNCTION je_set_default_lines(in_rowcount int) returns int
 as
 $$

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.