Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WkbGF-0006HO-En for pgsql-odbc@arkaria.postgresql.org; Wed, 14 May 2014 15:38:27 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WkbGE-0005DP-M5 for pgsql-odbc@arkaria.postgresql.org; Wed, 14 May 2014 15:38:26 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WkbGD-0005DG-Jt for pgsql-odbc@postgresql.org; Wed, 14 May 2014 15:38:25 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WkbG9-0000hw-Sa for pgsql-odbc@postgresql.org; Wed, 14 May 2014 15:38:24 +0000 Received: from compute1.internal (compute1.nyi.mail.srv.osa [10.202.2.41]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id AFF0A20DA0; Wed, 14 May 2014 11:38:18 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Wed, 14 May 2014 11:38:18 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=aklaver.com; h= message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; s=mesmtp; bh=qoGyjamodcMO7rPM1XLCbKsBYAc=; b=T2MOE1K4l+gjjWN91h7YOYz7yJ6u JC059uDdsolqCmrR4EScSZFhaPX5Je4yhT9eO2yI5k0ejXNrZQkfSYilGkFLVKsT 84G/ttxVubbmpOS/C1gPZTwfb4hBlGPuIs19XS/kscl5z/GB86lhFabHM8pakEqS AAbCcEjWrRh8kro= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; s=smtpout; bh=qoGyjamodcMO7rPM1XLCbK sBYAc=; b=FGLi1JcsO9aj4ZomXW9w1MZSvRPlcvmF4yGdD9oLnHwuyAPuYV3Ryn 4QRewtc86HxkMvKy5YKQz7gAoMies7V2tcFT8VgUtycs0sEjF+xMR6IWyutFyB2D vX2ugdRXDhhxeIipIOzVNSR+cgA4U1izUO3v/wdNYIzYlyOKAAu1Y= X-Sasl-enc: TRaGEFHP/bFE3GPcDQumLrR6vgSjmyazT9bCRsirD95F 1400081898 Received: from killi.site (unknown [173.160.167.74]) by mail.messagingengine.com (Postfix) with ESMTPA id 61EA0680140; Wed, 14 May 2014 11:38:17 -0400 (EDT) Message-ID: <53738DEB.3030008@aklaver.com> Date: Wed, 14 May 2014 08:38:19 -0700 From: Adrian Klaver User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Barry Bell , Hiroshi Saito , Michael Paquier , Hiroshi Inoue CC: Heikki Linnakangas , Anna Gershnik , "pgsql-odbc@postgresql.org" Subject: Re: psqlODBC text length with no records References: <152de38c9c2544b9b61f9a2f77e9aa3d@BY2PR08MB281.namprd08.prod.outlook.com> <5372B875.3010407@aklaver.com> <3fca930240554b80bc4174911fb49400@BY2PR08MB281.namprd08.prod.outlook.com> <53736874.2090905@aklaver.com> <53736E22.4090506@aklaver.com> <53737480.6070808@aklaver.com> <14cee66c2d5d444a8ec0c4c773f20d5b@BY2PR08MB281.namprd08.prod.outlook.com> <53737AAC.9060201@aklaver.com> <53738B4D.1030507@aklaver.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.7 (--) 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 On 05/14/2014 08:29 AM, Barry Bell wrote: > Sending the SQL through the postgres driver to a Postgres ver 9 server, where it runs, > I see the data types in the client software that is calling the ODBC driver > (in this case VFP, foxpro). So you are not really looking at the output of the ODBC driver but of VFP. Are you sure VFP is not doing the type casting? The reason I ask is demonstrated below where initcap on the Postgres side consistently returns text. aklaver@test=> \d varchar_test Table "public.varchar_test" Column | Type | Modifiers --------+-------------------+----------- fld_1 | character varying | fld_2 | character varying | aklaver@test=> CREATE TABLE test_1 as select initcap(fld_1), fld_2 from varchar_test ; aklaver@test=> \d test_1 Table "public.test_1" Column | Type | Modifiers ---------+-------------------+----------- initcap | text | fld_2 | character varying | aklaver@test=> CREATE TABLE test_2 as select initcap(fld_1), fld_2 from varchar_test where 1=0; aklaver@test=> \d test_2 Table "public.test_2" Column | Type | Modifiers ---------+-------------------+----------- initcap | text | fld_2 | character varying | aklaver@test=> CREATE TABLE test_3 as select initcap('ABCD'); aklaver@test=> \d test_3 Table "public.test_3" Column | Type | Modifiers ---------+------+----------- initcap | text | > > > Barry Bell > Senior Developer/Analyst > Logistics > Harte Hanks > 1525 NW 3rd ST > Deerfield Beach FL, 33442 > 954-429-3771 Ext 267 office > 954-281-1464 fax > > hartehanks.com / linkedin / twitter / facebook > > -----Original Message----- > From: Adrian Klaver [mailto:adrian.klaver@aklaver.com] > Sent: Wednesday, May 14, 2014 11:27 AM > To: Barry Bell; Hiroshi Saito; Michael Paquier; Hiroshi Inoue > Cc: Heikki Linnakangas; Anna Gershnik; pgsql-odbc@postgresql.org > Subject: Re: [ODBC] psqlODBC text length with no records > > On 05/14/2014 07:29 AM, Barry Bell wrote: >> Behavior seems different if you get the text from table vs fixed value. >> >> The select 'ABCDE' from dual return a text(longchar, memo), >> The select initcap(varcharfield) from varchartable returns varchar >> The select initcap(varcharfield) from varchartable where 1=0 returns >> text(longchar, memo), > > Where are you determining the data types? > > In other words you run the SQL where and you see the output and data type where? > > >> >> >> >> Barry Bell > > -- Adrian Klaver adrian.klaver@aklaver.com -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc