Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 9CCE2475CB4 for ; Sun, 11 Aug 2002 09:59:17 -0400 (EDT) Received: from fam-meskes.de (28-78.E.dial.o-tel-o.net [212.144.28.78]) by postgresql.org (Postfix) with ESMTP id 093D8475C9E for ; Sun, 11 Aug 2002 09:59:14 -0400 (EDT) Received: by fam-meskes.de (Postfix, from userid 1000) id 56040A6012; Sun, 11 Aug 2002 15:58:51 +0200 (CEST) Date: Sun, 11 Aug 2002 15:58:51 +0200 From: Michael Meskes To: William West Cc: pgsql-interfaces@postgresql.org Subject: Re: ECGP - varchar in struct? Message-ID: <20020811135851.GE3797@feivel.fam-meskes.de> Mail-Followup-To: William West , pgsql-interfaces@postgresql.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.28i X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/26 X-Sequence-Number: 2988 On Fri, Jul 26, 2002 at 09:38:25PM -0400, William West wrote: > It would appear that ecpg will only re-write a > varchar if it is found in a DECLARE statement, > because the varchar gets past the ecpg preprocessor's > INCLUDE as-is ... and, of course, the real C compiler > does not know what a 'varchar' is, so it complains. Yes, ecpg only parses stuff inside the declare section. A full syntax checking mode would be a nice add-on (and is listed as todo) but IMO it is not really needed urgently. > As a PostgreSQL 'newbie', I am not sure if it is more > work to fix ecpg or to re-write how the application > does things. I see it is a 'yacc' unit that handles the > re-writing that ecpg now does, but I do not know > 'yacc-ese' and do not know what else would be involved > to fix ecpg to work like PRO-C? Yes, it's quite some work. :-) But if you volunteer I gladly accept patches. :-) > - Did I miss something here? Yes, at first you can list you struct definition inside the declare section and it will work nicely. And second you can use a typedef command that AFAIK Pro*C does not have. This should help you without much work. > varchar re-writes during INCLUDE and not > just during DECLARE? Actually it does not have anything to do with INCLUDE or I misunderstood your problem comletely. Hope this helps. Michael -- Michael Meskes Michael@Fam-Meskes.De Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!