Received: from yara.imsd.uni-mainz.de (yara.IMSD.Uni-Mainz.DE [134.93.144.68]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f924Skn08831 for ; Tue, 2 Oct 2001 00:28:46 -0400 (EDT) (envelope-from wagner@imsd.uni-mainz.de) Received: (from smap@localhost) by yara.imsd.uni-mainz.de (8.9.3/8.9.3/lxs_5.2) id GAA12287 for ; Tue, 2 Oct 2001 06:28:44 +0200 Received: from hermes.imsd.uni-mainz.de(134.93.64.80) by yara.imsd.uni-mainz.de via smap (V2.1/2.1+anti-relay+anti-spam) id xma012285; Tue, 2 Oct 01 06:28:39 +0200 Received: from magnus (unverified [134.93.64.112]) by hermes.imsd.uni-mainz.de (EMWAC SMTPRS 0.83) with SMTP id ; Tue, 02 Oct 2001 06:26:01 +0200 Content-Type: text/plain; charset="iso-8859-15" From: Markus Wagner Organization: IMSD To: pgsql-sql@postgresql.org Subject: using SQL to evaluate arbitrary expressions? Date: Tue, 2 Oct 2001 06:32:15 +0200 X-Mailer: KMail [version 1.2] MIME-Version: 1.0 Message-Id: <01100206321504.01063@magnus> Content-Transfer-Encoding: 8bit X-Archive-Number: 200110/5 X-Sequence-Number: 4960 Hi, we need to process user-defined integrity conditions, which are stored as strings at application level, e. g. "person.age - 2 > 18". We would like to substitute the variable names within these expressions by their values at trigger time. So we have expressions containing constants only, e. g. "29 - 2 > 18". We are glad to have found out that we can evaluate such expressions simply by calling them with SELECT, e. g. "SELECT 29 - 2 > 18" returns true. We think that it would be very nice to benefit from the pg database system parser. But can we rely on this functionality in the future? Is this standard SQL? Thank you, Markus