X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id BBAA69DC880 for ; Mon, 30 Jan 2006 16:10:48 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 67720-05 for ; Mon, 30 Jan 2006 16:10:49 -0400 (AST) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 672A49DC855 for ; Mon, 30 Jan 2006 16:10:46 -0400 (AST) Received: from furbychan.cocan.org (furbychan.cocan.org [80.68.91.176]) by svr4.postgresql.org (Postfix) with ESMTP id F219F5AF05F for ; Mon, 30 Jan 2006 20:10:47 +0000 (GMT) Received: from rich by furbychan.cocan.org with local (Exim 3.35 #1 (Debian)) id 1F3fn5-0004L0-00 for ; Mon, 30 Jan 2006 20:38:23 +0000 Date: Mon, 30 Jan 2006 20:38:22 +0000 To: pgsql-interfaces@postgresql.org Subject: Find out if a parameter/return field is NULLABLE using Describe Message-ID: <20060130203822.GA16111@furbychan.cocan.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.9i From: Richard Jones X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200601/44 X-Sequence-Number: 5960 It doesn't seem to be possible to find out if a parameter or result field is nullable using the Describe protocol. For example if I have this table and statement: create table employees ( id serial not null primary key, name text not null, email text <-- this field ); insert into employees (name, email) values ($1, $2); Then the only information I get back about $2 is that it's a TEXT (OID = 25), when clearly $1 and $2 are different in that one is nullable and the other isn't. Similarly, select name, email from employees; This time I get more information about the types, including a modifier and length, but I can't see whether that lets me find out that one could be NULL and the other can never be. So is this possible? Rich. -- Richard Jones, CTO Merjis Ltd. Merjis - web marketing and technology - http://merjis.com Team Notepad - intranets and extranets for business - http://team-notepad.com