Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id DAB041337B93 for ; Wed, 20 Apr 2011 13:29:13 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 99636-06 for ; Wed, 20 Apr 2011 16:29:05 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 11F2A1337B54 for ; Wed, 20 Apr 2011 13:29:04 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p3KGT2lb028427; Wed, 20 Apr 2011 12:29:02 -0400 (EDT) To: Andrew Dunstan cc: Bruce Momjian , Robert Haas , pgsql-hackers@postgresql.org Subject: Re: pgindent weirdness In-reply-to: <4DAF086F.6050305@dunslane.net> References: <201104200948.p3K9mY501163@momjian.us> <4DAEF8AB.5030103@dunslane.net> <27646.1303314228@sss.pgh.pa.us> <4DAF086F.6050305@dunslane.net> Comments: In-reply-to Andrew Dunstan message dated "Wed, 20 Apr 2011 12:23:11 -0400" Date: Wed, 20 Apr 2011 12:29:02 -0400 Message-ID: <28426.1303316942@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201104/1048 X-Sequence-Number: 186250 Andrew Dunstan writes: > But in any case, *none* of the individual files knows about > BulkInsertStateData as a typedef: > ... > And the reason is actually fairly obvious on closer inspection. The only > place we actually use the BulkInsertStateData typedef (as opposed to the > struct declaration) is here: > ./backend/access/heap/heapam.c: bistate = (BulkInsertState) > palloc(sizeof(BulkInsertStateData)); > and that sizeof operation will be resolved at compile time and never hit > the symbol table. Oh, interesting. So you're saying that for this mechanism to know that "foo" is a typedef, there has to be at least one variable in the code that's declared as being of type foo or foo *? (Where "variable" would include function parameters, fields of other structs, etc.) That's probably fine, because otherwise we'd have the typedef list cluttered with junk we don't care about from system headers. So in the case at hand, we actually *need* to remove the "struct" from RelationGetBufferForTuple's declaration, so that BulkInsertStateData gets used as a typedef name in that way. regards, tom lane