X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 73E149DCB32 for ; Thu, 12 Jan 2006 01:16:18 -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 94210-02 for ; Thu, 12 Jan 2006 01:16:17 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by postgresql.org (Postfix) with ESMTP id 15F1A9DCB38 for ; Thu, 12 Jan 2006 01:16:15 -0400 (AST) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id k0C5G62x009273 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 11 Jan 2006 22:16:08 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.4/8.13.4) with ESMTP id k0C5G6J0091159; Wed, 11 Jan 2006 22:16:06 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.4/8.13.4/Submit) id k0C5G5ck091158; Wed, 11 Jan 2006 22:16:05 -0700 (MST) (envelope-from mfuhr) Date: Wed, 11 Jan 2006 22:16:05 -0700 From: Michael Fuhr To: Colton A Smith Cc: pgsql-admin@postgresql.org Subject: Re: strange system columns Message-ID: <20060112051605.GA91092@winnie.fuhr.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.093 required=5 tests=[AWL=0.093] X-Spam-Score: 0.093 X-Spam-Level: X-Archive-Number: 200601/141 X-Sequence-Number: 20229 On Thu, Jan 05, 2006 at 03:17:02PM -0500, Colton A Smith wrote: > SELECT attname, typname, attnum > FROM pg_attribute INNER JOIN pg_type > ON pg_attribute.atttypid = pg_type.typelem > WHERE pg_attribute.attrelid = $oid (derived above) > AND NOT attisdropped; The join condition for pg_type should be against pg_type.oid, not pg_type.typelem. A simplified version of your two queries is: SELECT attname, atttypid::regtype, attnum FROM pg_attribute WHERE attrelid = 'organic_matter'::regclass AND NOT attisdropped; -- Michael Fuhr