X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 77F24D1CAC7 for ; Sat, 6 Mar 2004 21:55:34 +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 28771-04 for ; Sat, 6 Mar 2004 17:55:35 -0400 (AST) Received: from sccrmhc13.comcast.net (sccrmhc13.comcast.net [204.127.202.64]) by svr1.postgresql.org (Postfix) with ESMTP id 5FB92D1CA67 for ; Sat, 6 Mar 2004 17:55:32 -0400 (AST) Received: from [10.0.1.2] (h000393e3ce55.ne.client2.attbi.com[24.91.235.158]) by comcast.net (sccrmhc13) with SMTP id <2004030621553301600ggquke>; Sat, 6 Mar 2004 21:55:33 +0000 User-Agent: Microsoft-Entourage/10.1.4.030702.0 Date: Sat, 06 Mar 2004 16:55:33 -0500 Subject: Re: Feature request: smarter use of conditional indexes From: John Siracusa To: Postgres Performance Message-ID: In-Reply-To: <18409.1078607169@sss.pgh.pa.us> Mime-version: 1.0 Reply-To: siracusa@mindspring.com Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/77 X-Sequence-Number: 5933 On 3/6/04 4:06 PM, Tom Lane wrote: > John Siracusa writes: >> So apparently all I can do is find out if it's a null test, but not if it is >> specifically "IS NOT NULL" > > No, because once you have determined that the node really IsA NullTest, > you can cast the pointer to (NullTest *) and look at the > NullTest-specific fields. I tried casting, but stupidly tried to access the type name (BoolTestType) instead of the field name (nulltesttype). Duh! :) > Think of this as poor man's object-oriented programming: Node is the supertype > of Expr which is the supertype of NullTest (and a lot of other kinds of nodes, > too). Yeah, I read that in the comments but was defeated by my devious brain ;) Thanks, I'll see how much farther I can go before getting stuck again :) -John