Re: ecpg problem - Mailing list pgsql-general

From Steve Clark
Subject Re: ecpg problem
Date
Msg-id 47C8326D.6030501@netwolves.com
Whole thread Raw
In response to ecpg problem  (Steve Clark <sclark@netwolves.com>)
Responses Re: ecpg problem
List pgsql-general
Steve Clark wrote:
> Hello List,
>
> Don't know whether anyone here can help but... We have some code that
> has compiled and ran just
> fine from postgresql 7.3.x thru 8.2.6. It uses embedded sql. I just
> yesterday upgraded our test system to
> 8.3.0 and this code will no longer compile. Below is a standalone code
> fragment in which I have removed
> everything but what is causing the problem. Any help or ideas would be
> appreciated.
>
> exec sql include sqlca;
>
> EXEC SQL WHENEVER NOT FOUND CONTINUE;
>
> // this array is grown as messages from new units are received
> // it is sorted by unit_serial_no ascending to support binary searches
>
> int getUnitData()
> {
>
>      exec sql begin declare section;
>
>          VARCHAR h_unit_serial_no  [ 15+1];
>          // we do an array fetch on these 30 is the max number for these
>          int     h_remote_int_netmask    [4096];
>          int     h_local_int_netmask     [4096];
>          VARCHAR h_tunnel_active         [4096][   1+1];
>          VARCHAR h_tunnel_config_type    [4096][   1+1];
>          VARCHAR h_local_vpn_int_ip      [4096][  20+1];
>          VARCHAR h_local_vpn_ext_ip      [4096][  20+1];
>          VARCHAR h_remote_vpn_int_ip     [4096][  20+1];
>          VARCHAR h_remote_vpn_ext_ip     [4096][  20+1];
>
>      exec sql end declare section;
>
>          exec sql select tunnel_active,
>                          tunnel_config_type,
>                          host(local_int_gw_ip),
>                          host(local_ext_gw_ip),
>                          host(remote_int_gw_ip),
>                          host(remote_ext_gw_ip),
>                          masklen(remote_int_gw_ip),
>                          masklen(local_int_gw_ip)
>                  into    :h_tunnel_active,
>                          :h_tunnel_config_type,
>                          :h_local_vpn_int_ip,
>                          :h_local_vpn_ext_ip,
>                          :h_remote_vpn_int_ip,
>                          :h_remote_vpn_ext_ip,
>                          :h_remote_int_netmask,
>                          :h_local_int_netmask
>                  from t_vpn_tunnel_status
>                  where unit_serial_no = :h_unit_serial_no
>              order by oid;
>              /*limit 30;*/
>      return TRUE;
> }
> gmake -k ecpg_test.o
> /usr/local/bin/ecpg -I/usr/local/include/pgsql -I/usr/local/include
> ecpg_test.pgc
> mkdep -O2 -Wall -DDEBUG -I../include -I/usr/local/include/pgsql
> -I/usr/local/include -I../common crypt_file.c mailuser.c
> srm2_monitor_server.c putfiles.c srm2_server_funcs.c escalate.c
> packet_loss.c srm2_cron.c srm2_db_funcs.c srm2_monitor_db.c ecpg_test.c
> g++ -O2 -Wall -DDEBUG -I../include -I/usr/local/include/pgsql
> -I/usr/local/include -I../common -c ecpg_test.c
> ecpg_test.pgc: In function `int getUnitData()':
> ecpg_test.pgc:36: error: invalid application of `sizeof' to incomplete
> type `varchar_h_tunnel_active'
> ecpg_test.pgc:38: error: invalid application of `sizeof' to incomplete
> type `varchar_h_tunnel_config_type'
> ecpg_test.pgc:40: error: invalid application of `sizeof' to incomplete
> type `varchar_h_local_vpn_int_ip'
> ecpg_test.pgc:42: error: invalid application of `sizeof' to incomplete
> type `varchar_h_local_vpn_ext_ip'
> ecpg_test.pgc:44: error: invalid application of `sizeof' to incomplete
> type `varchar_h_remote_vpn_int_ip'
> ecpg_test.pgc:46: error: invalid application of `sizeof' to incomplete
> type `varchar_h_remote_vpn_ext_ip'
> gmake: *** [ecpg_test.o] Error 1
>
> Compilation exited abnormally with code 2 at Fri Feb 29 09:59:10
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
>                http://www.postgresql.org/docs/faq
>
>

Actually it appears to work in 8.2.5 but be broken in 8.2.6 and 8.3.0.

Steve

pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Insert vs Update syntax
Next
From: "Dan Armbrust"
Date:
Subject: Re: errors in pg_restore on windows?