X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 85913D1DAD1 for ; Wed, 28 Jan 2004 09:39:20 +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 97933-07 for ; Wed, 28 Jan 2004 05:38:47 -0400 (AST) Received: from curie.credativ.org (credativ.com [217.160.209.18]) by svr1.postgresql.org (Postfix) with ESMTP id 36C2AD1D8BF for ; Wed, 28 Jan 2004 05:38:45 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by curie.credativ.org (Postfix) with ESMTP id EA9655601F; Wed, 28 Jan 2004 10:38:44 +0100 (CET) Received: from www.credativ.de (p509271E1.dip.t-dialin.net [80.146.113.225]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by curie.credativ.org (Postfix) with ESMTP id 7B0C355EED; Wed, 28 Jan 2004 10:38:39 +0100 (CET) Received: from feivel (feivel.credativ.de [172.26.14.57]) by www.credativ.de (Postfix) with ESMTP id 5814A1C000B; Wed, 28 Jan 2004 10:38:37 +0100 (CET) Received: by feivel (Postfix, from userid 1000) id 1A0164AED7; Tue, 27 Jan 2004 18:53:54 +0100 (CET) Date: Tue, 27 Jan 2004 18:53:54 +0100 From: Michael Meskes To: Edmund Bacon Cc: pgsql-interfaces@postgresql.org Subject: Re: ECPG and typedef struct Message-ID: <20040127175354.GA2167@1> Mail-Followup-To: Edmund Bacon , pgsql-interfaces@postgresql.org References: <1074537096.4164.117.camel@elb_lx.onesystem.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1074537096.4164.117.camel@elb_lx.onesystem.ca> User-Agent: Mutt/1.5.5.1+cvs20040105i X-Virus-Scanned: by AMaViS at credativ.com X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/15 X-Sequence-Number: 4684 On Mon, Jan 19, 2004 at 11:31:36AM -0700, Edmund Bacon wrote: > Is it still necessary to define SQL TYPEs twice? It depends, but teh way you ask, yes. > Is there some less maintenance-error-prone way to accomplish this? I > know about the -c option to ecpg, but this doesn't help if I need to > access the defined type from a .c file. Why? Can't you just put it into a header file that is processed by ecpg to create a C header and use "-c" for this? Okay, this does include the ecpg headers also, but if that's the problem we could add an option easily. How about an option "parsing header file"? > Ideally the C level typedef would be in a .h file somewhere and either > #include-ed or EXEC SQL INCLUDE-ed into .c or .pgc file Would it be okay to do this: Write a *.pgh file, that is SQL-INCLUDE-ed in embedded sql files. For C you'd call "ecpg -h" on that file, making ecpg produce a .h file, that can be included by your C code. Hmm, I think I'm going to implement that immediately. :-) Michael -- Michael Meskes Email: Michael at Fam-Meskes dot De ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!