X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 0389A8BA58A for ; Sat, 19 Feb 2005 17:13:44 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 03376-03 for ; Sat, 19 Feb 2005 17:13:34 +0000 (GMT) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by svr1.postgresql.org (Postfix) with ESMTP id 25F8A8BA169 for ; Sat, 19 Feb 2005 17:13:33 +0000 (GMT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1D2Y7T-0004rT-LM for pgsql-jdbc@postgresql.org; Sat, 19 Feb 2005 18:10:16 +0100 Received: from dsl-082-083-001-031.arcor-ip.net ([82.83.1.31]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 19 Feb 2005 18:10:15 +0100 Received: from skoehler by dsl-082-083-001-031.arcor-ip.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 19 Feb 2005 18:10:15 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-jdbc@postgresql.org From: =?ISO-8859-15?Q?Sven_K=F6hler?= Subject: How to get generated primary key? Date: Sat, 19 Feb 2005 18:15:54 +0100 Lines: 13 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: dsl-082-083-001-031.arcor-ip.net User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en X-Gmane-MailScanner: Found to be clean X-Gmane-MailScanner: Found to be clean X-Gmane-MailScanner-SpamScore: s X-MailScanner-From: sql-pgsql-jdbc@m.gmane.org X-MailScanner-To: pgsql-jdbc@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200502/134 X-Sequence-Number: 12314 Hi, i know about the nextval and currval functions, but i don't like them, since they don't apply to tables. To get the generated key, you have to know the name of the sequence, not just the name of the table. Does the JDBC-Driver implement the getGeneratedKeys() method? If not, does PostgreSQL provide any way to get the just generated key, without knowing the sequencename? Thx Sven