On Tue, Sep 25, 2007 at 02:20:34PM +0200, Magnus Hagander wrote:
> Irrk. The C file is very wrong indeed. Here's the relevant part where it
> shoudl be declaring 'customer':
> /* exec sql type customer is struct { #line 12 "array_of_struct.pgc" struct
> varchar_name_12 { int len; char arr[ 50 ]; } name ; #line 13
> "array_of_struct.pgc" int phone ; } */ #line 14 "array_of_struct.pgc"
>
>
> (all on one line, in case the MUA wraps it)
On Linux it's wrapped. But the new line problem is not what's breaking
the compiler.
> Seems like the entire definition of the struct is commented out?
This is indeed the problem. I attach the diff so you see that instead of
typedef'ing the struct it just comments it out.
Michael
--
Michael Meskes
Email: Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: [EMAIL PROTECTED]
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!
--- /home/postgres/pgsql-ecpg/test/expected/preproc-array_of_struct.c 2007-08-14 12:53:51.000000000 +0200
+++ array_of_struct.c 2007-09-25 14:54:59.000000000 +0200
@@ -11,7 +11,7 @@
#include <stdio.h>
-#line 1 "regression.h"
+#line 1 "./../regression.h"
@@ -31,23 +31,23 @@
#line 7 "array_of_struct.pgc"
-typedef struct {
+/* exec sql type customer is struct {
#line 12 "array_of_struct.pgc"
struct varchar_name_12 { int len; char arr[ 50 ]; } name ;
#line 13 "array_of_struct.pgc"
int phone ;
- } customer ;
+ } */
#line 14 "array_of_struct.pgc"
-typedef struct ind {
+/* exec sql type cust_ind is struct ind {
#line 19 "array_of_struct.pgc"
short name_ind ;
#line 20 "array_of_struct.pgc"
short phone_ind ;
- } cust_ind ;
+ } */
#line 21 "array_of_struct.pgc"
---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at
http://www.postgresql.org/about/donate