Received: from candle.pha.pa.us (root@s5-03.ppp.op.net [209.152.195.67]) by hub.org (8.8.8/8.7.5) with ESMTP id WAA00908; Thu, 23 Apr 1998 22:01:05 -0400 (EDT) Received: (from maillist@localhost) by candle.pha.pa.us (8.8.5/8.8.5) id VAA09828; Thu, 23 Apr 1998 21:37:33 -0400 (EDT) From: Bruce Momjian Message-Id: <199804240137.VAA09828@candle.pha.pa.us> Subject: Re: [HACKERS] Re: [INTERFACES] retrieving varchar size To: byronn@insightdist.com (Byron Nikolaidis) Date: Thu, 23 Apr 1998 21:37:33 -0400 (EDT) Cc: hannu@trust.ee, daveh@insightdist.com, pgsql-hackers@postgreSQL.org, pgsql-interfaces@postgreSQL.org In-Reply-To: <353FDE5F.30748CC1@insightdist.com> from "Byron Nikolaidis" at Apr 23, 98 08:35:43 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit > 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? -- Bruce Momjian | 830 Blythe Avenue maillist@candle.pha.pa.us | Drexel Hill, Pennsylvania 19026 + If your life is a hard drive, | (610) 353-9879(w) + Christ can be your backup. | (610) 853-3000(h)