X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id B2147D1C9C8 for ; Fri, 26 Mar 2004 10:22:56 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 23691-04 for ; Fri, 26 Mar 2004 06:22:43 -0400 (AST) Received: from curie.credativ.org (credativ.com [217.160.209.18]) by svr1.postgresql.org (Postfix) with ESMTP id 09C45D1EBB9 for ; Fri, 26 Mar 2004 06:22:44 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by curie.credativ.org (Postfix) with ESMTP id 39D4C55EFC; Fri, 26 Mar 2004 11:22:46 +0100 (CET) Received: from colt.pezone.net (dsl-213-023-254-194.arcor-ip.net [213.23.254.194]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by curie.credativ.org (Postfix) with ESMTP id 7D20555BEB; Fri, 26 Mar 2004 11:22:45 +0100 (CET) From: Peter Eisentraut To: "Preston A. Elder" , Tom Lane Subject: Re: Portable interfaces ... Date: Fri, 26 Mar 2004 11:22:43 +0100 User-Agent: KMail/1.5.1 Cc: pgsql-interfaces@postgresql.org References: <1080012121.10179.56.camel@temple.srealm.net.au> <15657.1080018332@sss.pgh.pa.us> <1080020317.10179.71.camel@temple.srealm.net.au> In-Reply-To: <1080020317.10179.71.camel@temple.srealm.net.au> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200403261122.43740.peter_e@gmx.net> X-Virus-Scanned: by AMaViS at credativ.com X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/28 X-Sequence-Number: 4807 Preston A. Elder wrote: > Does postgres have an API review team or anything? No. > I mean, not trying to offend anyone here, but I don't see how any API > where you cannot find out details about a table and its columns (such > as character encoding schemes in effect, data type for the column > (even if only for pre-defined data types), field lengths (for > strings/etc), etc) could be considered anything but deficient. http://www.postgresql.org/docs/7.4/static/information-schema.html > Add to this the "support" for unicode - I mean, its almost like it > was added as an afterthought, Indeed. > since the API won't help you, without > using non-portable facilities (ie. headers/etc that may or may not > exist on a system). I don't understand what the API has to do with Unicode. Either your strings are in Unicode or they are not. This is set by your application. > For now, I am (grudgingly) copying the OID codes, and going to use > system-based multibyte/unicode functions (and hope to heck that they > are compatible with postgres, but I get the feeling they are not > fully compatible after browsing pg_wchar.h) They should be. > is, right now, I have no verification on things like string lengths > because theres no real way to find out the maximum length of a field > (encoding-specific - ie. for UTF-8, a length of 20 means 20 chars, > for UTF-16, a length of 20 means 20 wchar_t's (40 bytes)). The libpq API gives you a way to determine the binary length of a returned datum. You need to allocate that dynamically. > What are the plans for the Postgres API - as I said, I > find it hard to believe I am the first to raise this issue, so are > there plans to have function calls to retrieve 'column properties' > and the like? The plans are more or less that if you don't like it, try using a different one, such as ODBC, or if a different programming language than C.