Received: from pc63.meskes.de (meskes@as13-029.rp-plus.de [149.221.92.157]) by hub.org (8.9.2/8.9.1) with ESMTP id CAA47795 for ; Wed, 17 Feb 1999 02:46:41 -0500 (EST) (envelope-from Michael.Meskes@gmx.net) Received: (from meskes@localhost) by pc63.meskes.de (8.9.3/8.9.3/Debian/GNU) id IAA08124 for pgsql-interfaces@postgreSQL.org; Wed, 17 Feb 1999 08:38:17 +0100 Date: Wed, 17 Feb 1999 08:38:16 +0100 From: Michael Meskes To: pgsql-interfaces@postgreSQL.org Subject: Re: ecpg with indicators not working Message-ID: <19990217083816.A8109@gmx.net> Mail-Followup-To: pgsql-interfaces@postgreSQL.org References: <36C0FD83.3A2C2F0A@pd.jaring.my> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="tThc/1wpZn/ma/RB" X-Mailer: Mutt 0.95.1i In-Reply-To: ; from James Thompson on Tue, Feb 16, 1999 at 09:14:10PM -0600 --tThc/1wpZn/ma/RB Content-Type: text/plain; charset=us-ascii On Tue, Feb 16, 1999 at 09:14:10PM -0600, James Thompson wrote: > exec sql > insert into > customer(uid,id,name_first,name_middle,name_last,company, > > address1,address2,city,state,country,zip,phone_work, > > phone_home,phone_fax,email,date_entered,billing_terms, > confirmation_method) > values (:uid,:uid:id_n,:name_first:name_first_n, > :name_middle:name_middle_n, :name_last:name_last_n, > :company:company_n,:address1:address1_n, > :address2:address2_n,:city:city_n,:state:state_n, > :country:country_n,:zip:zip_n,:phone_work:phone_work_n, > > :phone_home:phone_home_n,:phone_fax:phone_fax_n,:email:email_n, > date('now'),:billing_terms:billing_terms_n, > :confirmation_method:confirmation_method_n); > > > Adding the indicators to the above statement causes ecpg(from the 6.4.2 > distro) to seg fault while processing the statement. I defined each > indicator as the original var name with _n added to the end. I tried > type int and long. The statement preprocesses fine without the indicator > vars. Strange. Please try the attached test file. I defined all your variables as int and it works with ecpg versions 2.4.4 (PG 6.4.1), 2.4.9 and 2.5.0. > I dont know the proper method for looking into core files but by trial and > error I got gdb to produce (is this correct way to do this?) Yes. > [jamest@calvin obelib]$ gdb ecpg core > GNU gdb 4.17 > ... > #0 0x8054d81 in ECPGdump_a_type () > (gdb) bt > ... Could you please check where in ECPGdump_a_type it dumps core? The function is a pretty short one. Michael -- Michael Meskes | Go SF 49ers! Th.-Heuss-Str. 61, D-41812 Erkelenz | Go Rhein Fire! Tel.: (+49) 2431/72651 | Use Debian GNU/Linux! Email: Michael.Meskes@gmx.net | Use PostgreSQL! --tThc/1wpZn/ma/RB Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="tj.pgc" main() { exec sql begin declare section; int uid,id_n,name_first,name_first_n,name_middle,name_middle_n, name_last,name_last_n,company,company_n,address1,address1_n, address2,address2_n,city,city_n,state,state_n, country,country_n,zip,zip_n,phone_work,phone_work_n, phone_home,phone_home_n,phone_fax,phone_fax_n,email,email_n, billing_terms,billing_terms_n,confirmation_method,confirmation_method_n; exec sql end declare section; exec sql insert into customer(uid,id,name_first,name_middle,name_last,company, address1,address2,city,state,country,zip,phone_work, phone_home,phone_fax,email,date_entered,billing_terms, confirmation_method) values (:uid,:uid:id_n,:name_first:name_first_n, :name_middle:name_middle_n, :name_last:name_last_n, :company:company_n,:address1:address1_n, :address2:address2_n,:city:city_n,:state:state_n, :country:country_n,:zip:zip_n,:phone_work:phone_work_n, :phone_home:phone_home_n,:phone_fax:phone_fax_n,:email:email_n, date('now'),:billing_terms:billing_terms_n, :confirmation_method:confirmation_method_n); } --tThc/1wpZn/ma/RB--