Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cTF0K-0001FG-AF for pgsql-odbc@arkaria.postgresql.org; Mon, 16 Jan 2017 21:39:52 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cTF0J-00008D-TL for pgsql-odbc@arkaria.postgresql.org; Mon, 16 Jan 2017 21:39:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cRbRR-0006Wj-L5 for pgsql-odbc@postgresql.org; Thu, 12 Jan 2017 09:13:05 +0000 Received: from mail-wj0-x234.google.com ([2a00:1450:400c:c01::234]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cRbRM-0007Ga-Ca for pgsql-odbc@postgresql.org; Thu, 12 Jan 2017 09:13:04 +0000 Received: by mail-wj0-x234.google.com with SMTP id ew7so7505495wjc.3 for ; Thu, 12 Jan 2017 01:12:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denodo-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:message-id:date:user-agent:mime-version; bh=nnC1vhYOWuq/sYAYHogiKDqFlXTtbL+eQBKdY6oaWc4=; b=JuoHVv5u+Ig69wUWA4jb6X/Rui04DAvU3+NZ9qUEHJYmzQ3tPTlo26IzjXOOnGKruq Ct77n0YQ/txo6osm67Qi7OTLwthghNTs35tD4DU4AVgkW/6RA5nTw0YeZyUluFTPnwZS LEhkgcdZaPObTEDh4Fh0uvqguDviwyiJ4YF9DZdp2oV1mOwT+hX6tHmZt+qP8AgvAMm6 wk06UwuuuVidvNPbPWJxqVahRqCjWlxe14C/aiiGT6jnqs89bakukQnRTIrB6023mRpP s4kZYB96aUBuji8aCm4NTK+B+TMLenEfBQsHFZRu0MgRQLBB/pA5wOpZcYJ4OydFqgty hq0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:message-id:date:user-agent :mime-version; bh=nnC1vhYOWuq/sYAYHogiKDqFlXTtbL+eQBKdY6oaWc4=; b=p2jHOKwsHXlIuwzVyXjgLFXW5DnVS1DzL5AIBd+bKFRrjoduxxJwuxZvjkaOFpMMyw u1lIf70bWKhgbqtH48FeZLN2iUwInyWc8ZNicE8YLwNKOyePcldo1lQqrxgn0ozcwKKm VRdmgNQUOQuLOuDQR4dIg7rI5uVVj30IlRuzY6my2UlSRjGHOmT2Rmdr/aYkK07+i/GY EEeOb1Hia5HpCXq4a5ybTsyQANI2HHZ8jB1H+XKG8uGc0V9kJ6j+5inTz94YyXCXWm/W Bqhailc2BzHO7gntY8VyZ6Bq0fNUg3r8N57OOtQtb89JOmh0TkBR2naeZ3IfAF6bSlC1 l50w== X-Gm-Message-State: AIkVDXJgACNSYfutUproNsEDa833FHE4YzAXwdlx4NMd1hneOtUgONZVnGKPLKM9sSym2CzV6DLzYHLljGsmQbRJZ4sZ6rvW0UCFIrRUgeeUt2y1O/UiFxMrnA+NZe4qU+nPg+SQQPvwW2zAygE8IIiTn2bS+60kj79AGBYiZr3Itmnrp+ecf19LIA== X-Received: by 10.195.12.70 with SMTP id eo6mr6437924wjd.138.1484212378344; Thu, 12 Jan 2017 01:12:58 -0800 (PST) Received: from [192.168.0.38] (90.136.116.91.static.reverse-mundo-r.com. [91.116.136.90]) by smtp.gmail.com with ESMTPSA id l187sm2124016wml.6.2017.01.12.01.12.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Jan 2017 01:12:57 -0800 (PST) From: =?UTF-8?Q?Jacobo_S=c3=a1nchez?= To: pgsql-odbc@postgresql.org Subject: Question about SQLColumns results on VARCHAR types Message-ID: <0aa10fc0-9de9-2af0-445d-35ae5d109bc0@denodo.com> Date: Thu, 12 Jan 2017 10:12:56 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------1D067089CF0B0E4A025DB495" X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org This is a multi-part message in MIME format. --------------1D067089CF0B0E4A025DB495 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hello I have a question about metadata exposed using SQLColumns function. I have created the following table in PostgresSQL: CREATE TABLE testvarchar (vc2000 varchar(*2000*), vc500 varchar(*500*)) Then i configure a DSN (tested versions 9.3.400 and 9.5.400) and execute SQLColumns for the previous table getting the following results: "TABLE_QUALIFIER", "TABLE_OWNER", "TABLE_NAME", "COLUMN_NAME", "DATA_TYPE", "TYPE_NAME", "PRECISION", "LENGTH", "SCALE", "RADIX", "NULLABLE", "REMARKS", "COLUMN_DEF", "SQL_DATA_TYPE", "SQL_DATETIME_SUB", "CHAR_OCTET_LENGTH", "ORDINAL_POSITION", "IS_NULLABLE", "DISPLAY_SIZE", "FIELD_TYPE", "AUTO_INCREMENT", "PHYSICAL NUMBER", "TABLE OID", "BASE TYPEID", "TYPMOD" *ANSI with MaxVarchar 500:* "xxx", "xxx", "testvarchar", "vc2000", -1, "varchar", 2000, 6000, , , 1, "", , -1, , 6000, 1, , 2000, 1043, 0, 1, 46594, 0, 2000 "xxx", "xxx", "testvarchar", "vc500", 12, "varchar", 500, 500, , , 1, "", , 12, , 500, 2, , 500, 1043, 0, 2, 46594, 0, 500 *ANSI with MaxVarchar 2000* "xxx", "xxx", "testvarchar", "vc2000", 12, "varchar", 2000, 2000, , , 1, "", , 12, , 2000, 1, , 2000, 1043, 0, 1, 46594, 0, 2000 "xxx", "xxx", "testvarchar", "vc500", 12, "varchar", 500, 1500, , , 1, "", , 12, , 1500, 2, , 500, 1043, 0, 2, 46594, 0, 500 *UNICODE with MaxVarchar 500* "xxx", "xxx", "testvarchar", "vc2000", *-10*, "varchar", 2000, 4000, , , 1, "", , -10, , 4000, 1, , 2000, 1043, 0, 1, 46594, 0, 2000 "xxx", "xxx", "testvarchar", "vc500", -9, "varchar", 500, 1000, , , 1, "", , -9, , 1000, 2, , 500, 1043, 0, 2, 46594, 0, 500 *UNICODE with MaxVarchar 2000* "xxx", "xxx", "testvarchar", "vc2000", -9, "varchar", 2000, 4000, , , 1, "", , -9, , 4000, 1, , 2000, 1043, 0, 1, 46594, 0, 2000 "xxx", "xxx", "testvarchar", "vc500", -9, "varchar", 500, 1000, , , 1, "", , -9, , 1000, 2, , 500, 1043, 0, 2, 46594, 0, 500 I do not understand very well the variation between precision and length but my real question comes on DATA_TYPES. What i see is that using a MaxVarchar configuration for less than the varchar declared size it changes from VARCHAR (12) to LONGVARCHAR(-1). However using the UNICODE it comes from NVARCHAR(-9) to a code -10 which i can not find what really means. I expected to see -16? for LONGNVARCHAR. So what does -10 points to? and where can i find the mapping for it? Regards, Jacobo --------------1D067089CF0B0E4A025DB495 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

Hello

    I have a question about metadata exposed using SQLColumns function. I have created the following table in PostgresSQL:

CREATE TABLE testvarchar (vc2000 varchar(2000), vc500 varchar(500))

Then i configure a DSN (tested versions 9.3.400 and 9.5.400) and execute SQLColumns for the previous table getting the following results:

"TABLE_QUALIFIER", "TABLE_OWNER", "TABLE_NAME", "COLUMN_NAME", "DATA_TYPE", "TYPE_NAME", "PRECISION", "LENGTH", "SCALE", "RADIX", "NULLABLE", "REMARKS", "COLUMN_DEF", "SQL_DATA_TYPE", "SQL_DATETIME_SUB", "CHAR_OCTET_LENGTH", "ORDINAL_POSITION", "IS_NULLABLE", "DISPLAY_SIZE", "FIELD_TYPE", "AUTO_INCREMENT", "PHYSICAL NUMBER", "TABLE OID", "BASE TYPEID", "TYPMOD"

ANSI with MaxVarchar 500:

"xxx", "xxx", "testvarchar", "vc2000", -1, "varchar", 2000, 6000, <Null>, <Null>, 1, "", <Null>, -1, <Null>, 6000, 1, <Null>, 2000, 1043, 0, 1, 46594, 0, 2000
"xxx", "xxx", "testvarchar", "vc500", 12, "varchar", 500, 500, <Null>, <Null>, 1, "", <Null>, 12, <Null>, 500, 2, <Null>, 500, 1043, 0, 2, 46594, 0, 500

ANSI with MaxVarchar 2000

"xxx", "xxx", "testvarchar", "vc2000", 12, "varchar", 2000, 2000, <Null>, <Null>, 1, "", <Null>, 12, <Null>, 2000, 1, <Null>, 2000, 1043, 0, 1, 46594, 0, 2000
"xxx", "xxx", "testvarchar", "vc500", 12, "varchar", 500, 1500, <Null>, <Null>, 1, "", <Null>, 12, <Null>, 1500, 2, <Null>, 500, 1043, 0, 2, 46594, 0, 500

UNICODE with MaxVarchar 500

"xxx", "xxx", "testvarchar", "vc2000", -10, "varchar", 2000, 4000, <Null>, <Null>, 1, "", <Null>, -10, <Null>, 4000, 1, <Null>, 2000, 1043, 0, 1, 46594, 0, 2000
"xxx", "xxx", "testvarchar", "vc500", -9, "varchar", 500, 1000, <Null>, <Null>, 1, "", <Null>, -9, <Null>, 1000, 2, <Null>, 500, 1043, 0, 2, 46594, 0, 500

UNICODE with MaxVarchar 2000

"xxx", "xxx", "testvarchar", "vc2000", -9, "varchar", 2000, 4000, <Null>, <Null>, 1, "", <Null>, -9, <Null>, 4000, 1, <Null>, 2000, 1043, 0, 1, 46594, 0, 2000
"xxx", "xxx", "testvarchar", "vc500", -9, "varchar", 500, 1000, <Null>, <Null>, 1, "", <Null>, -9, <Null>, 1000, 2, <Null>, 500, 1043, 0, 2, 46594, 0, 500


I do not understand very well the variation between precision and length but my real question comes on DATA_TYPES. What i see is that using a MaxVarchar configuration for less than the varchar declared size it changes from VARCHAR (12) to LONGVARCHAR(-1). However using the UNICODE it comes from NVARCHAR(-9) to a code -10 which i can not find what really means. I expected to see -16? for LONGNVARCHAR.

So what does -10 points to? and where can i find the mapping for it?


Regards, Jacobo

--------------1D067089CF0B0E4A025DB495--