From 854d6db1e0908de79f24855652cafa340753fd6f Mon Sep 17 00:00:00 2001 From: Russ Tyndall Date: Fri, 24 Apr 2009 14:41:37 -0400 Subject: [PATCH] added the date_part postgresql operator --- sql/operations.lisp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sql/operations.lisp b/sql/operations.lisp index dbe3a0b..1b52925 100644 --- a/sql/operations.lisp +++ b/sql/operations.lisp @@ -158,6 +158,7 @@ :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 @@ -259,3 +260,10 @@ (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."))) -- 2.34.1