[SQL] TEXT blob extraction in ecpg

2005-01-10 Thread none none
Does any one know how to properly extract a TEXT type blob (undefined char 
length) in ecpg (Linux system)?  We are converting our SQL from Informix to 
PostGres.  Informix had a specific struct defined and I believe handled the 
dynamic memory allocation, but I cannot find any guidance on this issue for 
PostGres.  Anyone have any suggestions?

Thanks,
Tom

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


[SQL] TEXT type blob extraction in ecpg

2005-01-14 Thread none none
Does any one know how to properly extract a TEXT type blob (undefined char 
length) in ecpg (Linux system)?  We are converting our SQL from Informix to 
PostGres.  Informix had a specific struct defined and I believe handled the 
dynamic memory allocation, but I cannot find any guidance on this issue for 
PostGres.  Anyone have any suggestions?

Thanks,
Tom

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
  http://www.postgresql.org/docs/faqs/FAQ.html


[SQL] include in both ecpg and C++

2005-01-19 Thread none none
I have a header file that gets included by both C/C++ code and ecpg code.  
In this header are a few structs that get used by both code (C/C++ and 
ecpg).  In order to get this to work for Informix, we had to do something 
like this in the header file:

#ifdef TFLG
EXEC SQL BEGIN DECLARE SECTION
#endif
struct definitions
#ifdef TFLG
EXEC SQL END DECLARE SECTION
#endif
I use the EXEC SQL INCLUDE headerfile statement in my ecpg code, but of 
course, not the C/C++ code.

I believe the TFLG macro gets defined by the Informix precompiler (though I 
have not been able to verify this).  I also have not been able to find any 
sort of PostGres counterpart.

I am using the Informix compatibility switch when compiling ecpg, but do not 
get a successful compile (with a number of compile variations attempted).  
Does anyone know how to implement such a design?  Is there a PostGres macro 
that is basically the same thing or is there another method I may be able to 
use?

Thanks,
Tom

---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
 joining column's datatypes do not match