Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 2223563264C for ; Sat, 30 Jan 2010 17:19:03 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 67577-09 for ; Sat, 30 Jan 2010 21:18:52 +0000 (UTC) Received: from news.hub.org (news.hub.org [200.46.204.72]) by mail.postgresql.org (Postfix) with ESMTP id C7846634FD0 for ; Sat, 30 Jan 2010 17:18:52 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.14.3/8.14.3) with ESMTP id o0ULIn4i096367 for ; Sat, 30 Jan 2010 17:18:49 -0400 (AST) (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.14.3/8.14.3/Submit) id o0ULB4QC075463 for pgsql-jdbc@postgresql.org; Sat, 30 Jan 2010 17:11:04 -0400 (AST) (envelope-from news) From: Lew X-Newsgroups: pgsql.interfaces.jdbc Subject: Re: issuing insert preparedstatement queries with default values Date: Sat, 30 Jan 2010 16:11:04 -0500 Organization: albasani.net Lines: 15 Message-ID: References: <4B47C7E9.4030000@trustcommerce.com> <4B47E6A5.2090009@ttc-cmc.net> <4B47EF53.6090404@trustcommerce.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@albasani.net X-User-ID: v76COUF5FqWMfHZxsBIOfEWhigwZuqeqrftBZBLjUag= In-Reply-To: <4B47EF53.6090404@trustcommerce.com> Cancel-Lock: sha1:RFQMp36GPEeKxHqD/0Gl0AfDfNk= User-Agent: Thunderbird 2.0.0.23 (X11/20090817) X-NNTP-Posting-Host: BSf1t9sj4pIJYvt+cIqsg50IVvs80qWDghx3ft5j+bY= To: pgsql-jdbc@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=-10 required=5 tests=BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 201001/86 X-Sequence-Number: 20282 Johnny Luong wrote: > |> Is there a way to use the DEFAULT per column value on an INSERT sql in > |> PG through the PreparedStatement JDBC API? It'd be nice so that I don't > |> have to maintain a secondary list of PreparedStatements or a list of > |> default values maintained outside of the database definition. ... > | TableEntryForm addUpdateTableEntry() Connection Created > | INSERT INTO "public"."key_table4" ("avatar_id", "user_id", "bing_id") > | VALUES (?, ?, default) > | TableEntryForm addUpdateTableEntry() Connection Closed I just leave out the columns in the INSERT for which I want default values. -- Lew