added the date_part postgresql operator
authorRuss Tyndall <russ@acceleration.net>
Fri, 24 Apr 2009 18:41:37 +0000 (14:41 -0400)
committerRuss Tyndall <russ@acceleration.net>
Fri, 24 Apr 2009 18:41:37 +0000 (14:41 -0400)
sql/operations.lisp

index dbe3a0b36ed7cb71689c9e654371cdfa5e43518d..1b52925347434b6e6d56325d7a8ce35a164bc39b 100644 (file)
                      :name 'substr :args rest)
       (error 'sql-user-error :message "SUBSTR must have 3 arguments.")))
 
+
 (defsql sql-substring (:symbol "substring") (&rest rest)
   (if (= (length rest) 3)
       (make-instance 'sql-function-exp
       (make-instance 'sql-function-exp
                      :name 'upper :args rest)
     (error 'sql-user-error :message "UPPER must have 1 argument.")))
+
+(defsql sql-date_part (:symbol "date_part") (&rest rest)
+       "the date_part function for postgres"
+  (if (= (length rest) 2)
+      (make-instance 'sql-function-exp
+                     :name 'date_part :args rest)
+      (error 'sql-user-error :message "date_part must have 2 arguments.")))