Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YxDOt-0003C6-GH for pgsql-jdbc@arkaria.postgresql.org; Tue, 26 May 2015 11:52:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YxDOs-0008ID-IC for pgsql-jdbc@arkaria.postgresql.org; Tue, 26 May 2015 11:52:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YxDOr-0008I5-EE for pgsql-jdbc@postgresql.org; Tue, 26 May 2015 11:52:01 +0000 Received: from smtp.procolix.com ([95.215.185.30]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1YxDOm-0004T1-4h for pgsql-jdbc@postgresql.org; Tue, 26 May 2015 11:51:59 +0000 Received: from localhost (localhost [127.0.0.1]) by smtp.procolix.com (Postfix) with ESMTP id 95E7543AF8; Tue, 26 May 2015 13:51:54 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at smtp.procolix.com Received: from smtp.procolix.com ([127.0.0.1]) by localhost (host436.procolix.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mWISeeNJAHYs; Tue, 26 May 2015 13:51:52 +0200 (CEST) Received: from webmail.procolix.com (webmail.procolix.com [95.215.185.106]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: mark@lawinegevaar.nl) by smtp.procolix.com (Postfix) with ESMTPSA id DFCE943C82; Tue, 26 May 2015 13:51:52 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: Tue, 26 May 2015 13:51:52 +0200 From: Mark Rotteveel To: dmp Cc: PostgreSQL JDBC Subject: Re: Reading schema information In-Reply-To: <55633DFE.6020306@ttc-cmc.net> References: <55632843.8060109@ttc-cmc.net> <55633883.5060900@ttc-cmc.net> <55633DFE.6020306@ttc-cmc.net> Message-ID: <603930fe7a21fa575e0bd53972d38296@imap.procolix.com> X-Sender: mark@lawinegevaar.nl User-Agent: RoundCube Webmail/0.2 X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org On Mon, 25 May 2015 09:21:34 -0600, dmp wrote: > dmp wrote: >> dmp wrote: >>> Mansour Al Akeel wrote: ... >>>> We have: >>>> >>>> IS_GENERATEDCOLUMN String => Indicates whether this is a generated >>>> column >>>> >>>> YES --- if this a generated column >>>> NO --- if this not a generated column >>>> empty string --- if it cannot be determined whether this is a >>>> generated column >>>> >>>> >>>> My questions is, is this a bug ? if not, how can I obtain this >>>> information about a column (if it's generated or not) ? >>>> >> Hello, >> >> I'm sorry, after testing, currently the given name IS_GENERATEDCOLUMN is >> given the error as you describe. The index of 23 can be used to obtain >> the >> results desired. >> >> Did you search the mailing list for a report or issue on this? > > Sorry for an earlier error. > > rs = dbMetaData.getColumns(tableMetaData.getCatalogName(1), > tableMetaData.getSchemaName(1), > tableMetaData.getTableName(1), "%"); > > On further check, > org.postgresql.Abstractjdbc2DatabaseMetaData.getColumns() does > not implement the named Field IS_GENERATEDCOLUMN. As indicated using an > index > of 23 instead of the named Field should work. Index 23 is IS_AUTOINCREMENT which does not have the same meaning as IS_GENERATEDCOLUMN (index 24) which was added to the JDBC specification in Java 7 / JDBC 4.1. The former is only for one specific column type: auto increment (eg serial), while the latter is for all calculated or otherwise generated columns. Mark -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc