473,386 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

ecpg question

I wanted to ask this on here before going any further.

I've got functions that return rowsets, which from the psql shell require
me to write selects with AS TBL( ... ) to define the return types.

When I try to put a query together in ECPG to get values from these
functions, I discovered some nasty ecpg behavior.

EXEC SQL SELECT * FROM foo() AS TBL( c int );

compiles properly (?) to

{ ECPGdo(__LINE__, 0, 1, NULL, "select * from foo () as TBL ( c int )
", ECPGt_EOIT, ECPGt_EORT);}

however
EXEC SQL SELECT * FROM foo() AS TBL( c int, i int );

or any other query with multiple columns to a TBL description causes a
segfault in ecpg. It also concerns me that all other symbols are
dropped to lowercase, while TBL is still uppercase. Leads me to
believe that TBL isn't getting parsed. This was tested against cvs pgsql,
and the backtrace from the segfaults are consistent and appear below.

Program received signal SIGSEGV, Segmentation fault.
in strlen () from /usr/lib/libc.so.1
(gdb) bt
#0 in strlen () from /usr/lib/libc.so.1
#1 in cat2_str (str1=0xa5750 "c int ",
str2=0x2c <Address 0x2c out of bounds>) at preproc.y:80
#2 in cat_str (count=3) at preproc.y:103
#3 in _end ()
#4 in main (argc=2, argv=0xxxxxxxxx) at ecpg.c:395

I tried picking the rules apart that call cat_str in this case, but I
can't really figure out where in preproc.y it gets called and screws that
second var argument to cat_str up. Hopefully someone has dealt with this
before and can tell me why what I'm doing is wrong, or that I should send
this on to -hackers.

Thanks,
-George
we***@csh.rit.edu

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 12 '05 #1
2 1640
On Tue, Dec 23, 2003 at 02:06:14AM -0500, George Gensure wrote:
dropped to lowercase, while TBL is still uppercase. Leads me to
believe that TBL isn't getting parsed. This was tested against cvs pgsql,
and the backtrace from the segfaults are consistent and appear below.
Yes, it surely looks that way.
second var argument to cat_str up. Hopefully someone has dealt with this
before and can tell me why what I'm doing is wrong, or that I should send
this on to -hackers.


Not yet, but I will when I find the time.

Michael
--
Michael Meskes
Email: Michael at Fam-Meskes dot De
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: me****@jabber.org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 12 '05 #2
Cool. I only thought that tbl would need special treatment. Is that fix
in cvs?

Thanks,
-George

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Slava Gorski | last post by:
Hi all, It seems that get diagnostics is not supported by ecpg in postgresql 7.3, I always get the following error when trying to use it: ERROR: parse error at or near "diagnostics" For...
2
by: Thierry Missimilly | last post by:
Hi, I'm not sure it's a bug or it's normal, so i don't send it to pgsq-bugs. Well, i have written pgbench in PRO*C to have a common pgbench.pgc source for Postgres and Oracle. However, there...
4
by: Thierry Missimilly | last post by:
Hi, This is the wrong mailing list but I don't sent it to pgsql-bugs with success. ---------------------------(end of broadcast)--------------------------- TIP 7: don't forget to...
3
by: Carmen Gloria Sepulveda Dedes | last post by:
Hello. I have a problem with ecpg precompiler. In a code like: **** main() { .... some calls to EXEC SQL
3
by: Lynn.Tilby | last post by:
I am running 7.1.3... The docs for ecpg in 7.1.3 don't have the -e option in them! YET, ecpg -e WORKS!!! for solving the vacuum problem. Just WHAT does the -e option in ecpg do???? Thanks...
0
by: Lynn.Tilby | last post by:
I am running 7.1.3 at the moment and upgrading in the near future. I am noticing that some cursor declare statements are commented out in the .c after running the ecpg pre-processor with no...
1
by: George Gensure | last post by:
I wanted to ask this on here before going any further. I've got functions that return rowsets, which from the psql shell require me to write selects with AS TBL( ... ) to define the return types....
0
by: Christian Rank | last post by:
Today I ran into problems when combining a C program with SQL statements with the ECPG interface of PostgreSQL: According to the documentation, it should be possible with EXEC SQL WHENEVER NOT...
0
by: Valerie Schneider DSI/DEV | last post by:
Hi, I have a set of libraries and C/C++ programs with embedded access to a PG database. I'm using ecpg. I'm working on a Linux RedHat9 platform. Until now I was in PG 7.4.2 : $ ecpg --version...
1
by: Richard Connamacher | last post by:
I was looking through the docs, ECPG looks like a great tool for developing client applications. Anyone know if it's possible to set it up for use with Objective C in XCode on Mac OS X? XCode...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.