Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 852A3632B18 for ; Sun, 27 Dec 2009 21:31:54 -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 40905-08 for ; Mon, 28 Dec 2009 01:31:47 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from tremor.opencloud.co.nz (tremor.opencloud.co.nz [131.203.101.230]) by mail.postgresql.org (Postfix) with ESMTP id 564646328D6 for ; Sun, 27 Dec 2009 21:31:47 -0400 (AST) Received: from 122-57-40-95.jetstream.xtra.co.nz ([122.57.40.95] helo=[192.168.1.168]) by tremor.opencloud.co.nz with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1NP4SU-00017C-9E; Mon, 28 Dec 2009 14:31:42 +1300 Message-ID: <4B380A78.7080701@opencloud.com> Date: Mon, 28 Dec 2009 14:31:36 +1300 From: Oliver Jowett User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Maciek Sakrejda CC: =?UTF-8?B?RmlsaXAgUmVtYmlhxYJrb3dza2k=?= , Gianvito Pio , pgsql-jdbc@postgresql.org Subject: Re: Get a table name References: <4B3737DA.4070408@gmail.com> <92869e660912270459h55fd3024k97d8c5ee1d4cfd60@mail.gmail.com> <895e58dd0912271412hbf14159w8b2d71600f098bc0@mail.gmail.com> In-Reply-To: <895e58dd0912271412hbf14159w8b2d71600f098bc0@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200912/102 X-Sequence-Number: 20183 Maciek Sakrejda wrote: >> In general, no. That's because resultset columns can be "entangled" in more complex way than "column a of table b". > > Actually, this *is* defined at the protocol level: > No idea whether JDBC exposes this or whether the server actually sends > the correct oids, or if this is just part of the protocol as a > future-proofing attempt. The driver exposes this via PGResultSetMetadata.getBaseTableName(), and I believe the server does send useful data here. -O