pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Tea Yu <teayu1@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: JDBC executeUpdate returns 0 for table partitioning rule
Date: Tue, 6 Dec 2005 10:47:46 -0500 (EST)
Message-ID: <Pine.BSO.4.61.0512061045400.5324@leary.csoft.net> (raw)
In-Reply-To: <008701c5fa52$29d69c40$ca78a8c0@yawin.yesasia.com>
References: <008701c5fa52$29d69c40$ca78a8c0@yawin.yesasia.com>



On Tue, 6 Dec 2005, Tea Yu wrote:

> The scenario is quite simple - insert into a partitioned table in which a
> rule forwards the insertion into an inherited partition (Postgresql 8.1)
>
> However, JDBC returns 0 during Statement.executeUpdate(sql).  It behaves
> normally when partition rule is removed.

That's certainly not what I'm seeing here.  I've attached my testcase.  So 
I've shown you mine, now you show me yours.

Kris Jurka

Attachments:

Rule.java (text/plain, 625B) download import java.sql.*; public class Rule { public static void main(String args[]) throws Exception { Class.forName("org.postgresql.Driver"); Connection conn = DriverManager.getConnection("jdbc:postgresql://localhost:5820/jurka","jurka",""); Statement stmt = conn.createStatement(); stmt.execute("CREATE TEMP TABLE parent(a int)"); stmt.execute("CREATE TEMP TABLE child(b int) INHERITS (parent)"); stmt.execute("CREATE RULE r AS ON INSERT TO parent DO INSTEAD INSERT INTO child(a) VALUES (NEW.a);"); int count = stmt.executeUpdate("INSERT INTO parent VALUES(1)"); System.out.println(count); } }

view thread (5+ messages)  latest in thread

Message-ID: <Pine.BSO.4.61.0512061045400.5324@leary.csoft.net>
Permalink:  ../Pine.BSO.4.61.0512061045400.5324@leary.csoft.net/
Also on:    postgresql.org/message-id/Pine.BSO.4.61.0512061045400.5324@leary.csoft.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: books@ejurka.com, teayu1@gmail.com
  Subject: Re: JDBC executeUpdate returns 0 for table partitioning rule
  In-Reply-To: <Pine.BSO.4.61.0512061045400.5324@leary.csoft.net>
  References: <008701c5fa52$29d69c40$ca78a8c0@yawin.yesasia.com> <Pine.BSO.4.61.0512061045400.5324@leary.csoft.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox