7.2 behavior -- inserts, rules and jdbc - Mailing list pgsql-jdbc

From Richard Welty
Subject 7.2 behavior -- inserts, rules and jdbc
Date
Msg-id E18dVHz-000672-00@skipper.averillpark.net
Whole thread Raw
List pgsql-jdbc
first, the context: redhat 7.3, postgres 7.2.5, appropriate pgjdbc2.jar

i recently added a rule associated with a table insert. the rule calls a
stored pl/pgsql procedure to update another table in the database. i
couldn't find a way for the procedure to be called unless it returned a
value, so i declared it as returning int and return 1 every time.

the rule is as follows:

CREATE RULE OnPayment AS
ON INSERT TO payment
DO SELECT ApplyPayment ( new.customer_id,
                         new.against_credit_balance,
                         new.payment_type,
                         new.amount,
                         new.operator_id
                        );

so everything works now, _but_: if i use executeUpdate to issue my insert,
i get an SQL exception because a result is returned from ApplyPayment().
i ended up using executeQuery and ignoring the result set instead.

is this really the correct behavior, or have i missed something obvious?

thanks,
  richard
--
Richard Welty                                         rwelty@averillpark.net
Averill Park Networking                                         518-573-7592
              Unix, Linux, IP Network Engineering, Security

pgsql-jdbc by date:

Previous
From: Achilleus Mantzios
Date:
Subject: Re: 7.3.1 UTF-8 bug(?) and 7.2.x Charset compatibility
Next
From: Tony Grant
Date:
Subject: where to put postgresql.jar in Mac OS X