Received: from u1.abs.net (root@u1.abs.net [207.114.0.131]) by hub.org (8.8.8/8.7.5) with ESMTP id XAA23797 for ; Thu, 23 Apr 1998 23:44:05 -0400 (EDT) Received: from insightdist.com (nobody@localhost) by u1.abs.net (8.8.5/8.8.5) with UUCP id XAA00800 for pgsql-hackers@postgreSQL.org; Thu, 23 Apr 1998 23:14:30 -0400 (EDT) X-Authentication-Warning: u1.abs.net: nobody set sender to insightdist.com!byronn using -f Received: by insightdist.com (AIX 3.2/UCB 5.64/4.03) id AA24019; Thu, 23 Apr 1998 22:56:05 -0400 Received: from ppp0_ceodev by ceodev (AIX 4.1/UCB 5.64/4.03) id AA68430; Thu, 23 Apr 1998 22:51:28 -0400 Message-Id: <353FFC77.55A58CF5@insightdist.com> Date: Thu, 23 Apr 1998 22:44:07 -0400 From: Byron Nikolaidis X-Mailer: Mozilla 4.05 [en] (Win95; I) Mime-Version: 1.0 To: Bruce Momjian Cc: hannu@trust.ee, daveh@insightdist.com, pgsql-hackers@postgreSQL.org, pgsql-interfaces@postgreSQL.org Subject: Re: [HACKERS] Re: [INTERFACES] retrieving varchar size References: <199804240137.VAA09828@candle.pha.pa.us> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Bruce Momjian wrote: > > The problem with that theory is this. If the frontend application just > > executes some random query, such as "select * from table", you really do not > > know anything about what is coming back. You must rely on the little bit of > > information the protocol gives you. In the case of Postgres, it gives you > > the fieldname, datatype, and size for each column in the result. > > Unfortunately, for varchar and char(n), the size reports -1. This is not > > very helpful for describing the result set. > > > > Your above example works fine (in fact we use that already) when you know the > > table and column name, as in metadata functions such as SQLColumns() in the > > ODBC driver. > > Yep. We could pass back atttypmod as part of the PGresult. I can add > that to the TODO list. Would that help? Yes, that would do it! Thank you for listening to our ravings on this issue. Byron