Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ibWWu-0008EC-UW for pgsql-general@arkaria.postgresql.org; Sun, 01 Dec 2019 21:13:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ibWWs-0006JE-4R for pgsql-general@arkaria.postgresql.org; Sun, 01 Dec 2019 21:13:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ibWWr-0006J6-Jw for pgsql-general@lists.postgresql.org; Sun, 01 Dec 2019 21:13:17 +0000 Received: from mout.gmx.net ([212.227.15.18]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ibWWk-0002sO-BX for pgsql-general@lists.postgresql.org; Sun, 01 Dec 2019 21:13:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1575234784; bh=VyoJS3VzaKW48GrzK3VoQskR7/Kg016vXOSxpp6SxF0=; h=X-UI-Sender-Class:Subject:To:References:From:Date:In-Reply-To; b=bhPIB8H4WufEQEjE7E4XnxgqLwOTKOmYxf9KNJ6wd2i6mVtRdO2YdNYx6cIlvhY4E 8YnGjqkTGQkMbu4LtgO9iBGA8rHXEJbFYzbsy3Sno2BLrbOWsszRo33bxKQxTV1E5Q xAU2KYeECjDTo1rv57zS6RcUmLLAQRUHTJh50TK8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.178.20] ([188.174.164.93]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MPXhA-1iOxiP3Pvu-00MZcr for ; Sun, 01 Dec 2019 22:13:03 +0100 Subject: Re: Why are clobs always "0" To: pgsql-general@lists.postgresql.org References: <1575221495.4549.0@mac.com> From: Thomas Kellerer Message-ID: <4e8fc973-e6cb-5610-1e50-46bbb11e8813@gmx.net> Date: Sun, 1 Dec 2019 22:13:01 +0100 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.5.666 MIME-Version: 1.0 In-Reply-To: <1575221495.4549.0@mac.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: de-DE Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:P90cDUwQqwcBRv+7ZHz7zQSrFU0eLZbG41yqFRgxWNZT1XsdRjf xnv+5CpU0dOyqCSOwtmED44g/QtcUaoh1uNDXkZBBvqyGaolwq0uDCqiFviQgHNrpLlcYMx cEcwI7cqvARPqls81zfidDkj+0Be78ha92uypHWn/2PXC2n4u5yGP7GPzfuQsGTyUK4Qkkd GjNaw34hh6hMkcbIE1SVA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:cNIW4MtIVhY=:shuJibaGBKi4BsGM0UOCQ5 3vgi0XF4cXKA0MZE3DY34FbSS+IhxEiAVyg01P4FWhionWhMzWRRxzZWveFGPMDu0TwtI8yk7 +hLoGP1eRbXuyzg21JV+07YXkFhjcU+FcIOF0T4gDM9yU0aXkovNVkI/A40KfYsHHxeRRBmpn b9h9iAWq/pgRSMoDI9hXOk873onylwfWZutEfEtSvoIKbSyL0QMzXHL0PG+6JLzQl7HWJEQke eixjj8yr8A7eWJmhcvdS8gJ0vNS1/qLkxjuQ6Vhw2qoyXv0VBgzFu/D3NM6cmLkOBEwblQOEn zIjMwg5zrbodrkxuJ/d13GOFeG9R9rd1PAQ+zUuMUsYsV9aXlTANJU4PZi6HPpDdQszRgSsVE hTcQYHjKXJDe4pNn+Ub6qoyyVbBLOgJt/RxfrYH82nT7YMLYtYYEHM1jrenf1V5F4I/LW7buL gCfa1D5JpSGudacLDyIEO/O3uevrwR+gbEE7C70uS8dee/SwzbUg1ytoyOADmLZedgQPPj1rg 9L9YWHDcFfh0vZ2WugSjNDk9iekgHaK2e045lLW38EhVfJyOetSoWQoE+745RUVCTgPJsSlZ4 9NOCAzt5nehXYk6/f9kJP0h/j/BnnLWv9l8URBiLenPh5YsQusbnlwA432hSo/rHKlM7Y5vwS LsO/dIcX4R/bVPHOYVAAcBqYf31he271YdecsfTx/fDoLhCw9hC0w7pLm0Kt//TPj6OiZK9an zgXu8aISQ4F5cTuaxHx112MXpTdsXRAGTgRpJULETsVvYU4lnMUgNKwRWbeTQWxArmY65plYl TNnZO+jygdI+44Q1ze7cizDmS6WtpOC9XJUDpgAXoOIFfdmh+0PcPrOjPDVzhSRtpjo4VFAf+ XXiUjvU+z/KYncCSzN9KAYCoOwV/7bFF4Weebw/+KiRKFFMRDVFecdYxTc/3g+rWo4WvRATai CUj+W8/AXaOeV9XnafzodOsol2KfVZrtyq1gJONg9c15m17r6kw9Bdii2Jpski2bquzyb/B4m ahHxFFAxQ405AfOgzlHYQhS7D+/UhZO8zY5tBZazssHSmqs4IOH+yOZqw0r2v1esfR5T/3cea 1AUQgPGWNnasX0BfBzGxhpSt/GlKDaQ2uuLv85hVsEMS5C+mKrV4rtQLkuoCjK/hXFHHs2trl wBEKUfzVZXhYkzewVutnnaJK2MSGPucQpOoRVXh8HjCqbcmrVjuTIznmPfMjnYXLc4tczER1e iPfgRJum6rM06kocJgkneKYnX7kY6WtmV1eIygM7z8vTzEuc6zngZdLWae+M= List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Arnie Morein schrieb am 01.12.2019 um 18:31: > I have tested the most recent driver in three different SQL IDEs, and > now with an application I'm writing that uses JDBC metadata, the > comment on a field definition also isn't available as a string > value. > > The only thing I ever see regarding data type "text" field values are > either a 0 or a 1; neither of which applies. > > So why is this happening, even from the JDBC metadata results as > well? The Postgres JDBC driver does not have any problems with the "text" data type, neither with reporting it properly through DatabaseMetaData (it's reported as Types.VARCHAR) nor with retrieving values from such a column. The column size for such a column is reported as 2147483647 Column comments are reliably returned in the column "REMARKS" in the result of DatabaseMetaData.getColumns() Given the following table: create table test (data text); comment on column test.data is 'The text column'; then the following Java code: ResultSet rs =3D connection.getDatabaseMetaData().getColumn(null, "pu= blic", "test", "%"); rs.next(); System.out.println("column_name: " + rs.getString("COLUMN_NAME")); System.out.println("column_size: " + rs.getInt("COLUMN_SIZE")); System.out.println("data_type: " + rs.getInt("DATA_TYPE")); System.out.println("remarks: " + rs.getString("REMARKS")); will output: column_name: data column_size: 2147483647 data_type: 12 remarks: The text column With 12 being the value of java.sql.Types.VARCHAR Thomas