dbTalk Databases Forums  

Re: [BUGS] [INTERFACES] ECPG Connect user :variable problem

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss Re: [BUGS] [INTERFACES] ECPG Connect user :variable problem in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ryan Mooney
 
Posts: n/a

Default Re: [BUGS] [INTERFACES] ECPG Connect user :variable problem - 08-24-2003 , 03:01 PM







Sorry about that last patch, I hit the wrong one (my bison is
way out of date, so I'm hacking the resulting .c file for test
and backporting to the .y file, not that thats an excuse

Anyway here is a patch to 7.4b1 that seems to apply to the snap
from yesterday as well.

This allows you to

EXEC SQL CONNECT TO :target as :connection_name user :uname using assword;

and have the uname and password C variables get passed correctly to the
ECPGconnect fucntion after epgc processing.

On Tue, Aug 19, 2003 at 12:17:08PM -1000, Ryan Mooney wrote:
Quote:
Hello,

I'm having a major problem using ecpg with 7.4beta1. The problem is that
if I try to pass in the username or password as :variables to the EXEC SQL
CONNECT code they are essentially ignored (replaced by " ?").

I've tried it on both redhat 7.2 IA64 and Redhat 9.0 IA32 (different enough
that I don't think its the platform). I also tried it with postgres 7.3.2
which seemed to do the "right thing" and put the variables into the ECPGconnect
call.

Any thoughts?

------------------------------<snip "connect.pgc">---------------------------------
int pg_connect(void)
{

EXEC SQL BEGIN DECLARE SECTION;
char *target = "dbname";
char *connection_name = "myconnection";
char *uname = "myuser";
char *password = "mypassword";
EXEC SQL END DECLARE SECTION;

EXEC SQL CONNECT TO :target as :connection_name user :uname using assword;

}

------------------------------<snip "connect.c">---------------------------------

int pg_connect(void)
{

/* exec sql begin declare section */





#line 5 "connect.pgc"
char * target = "dbname" ;

#line 6 "connect.pgc"
char * connection_name = "myconnection" ;

#line 7 "connect.pgc"
char * uname = "myuser" ;

#line 8 "connect.pgc"
char * password = "mypassword" ;
/* exec sql end declare section */
#line 9 "connect.pgc"


{ ECPGconnect(__LINE__, 0, target , " ?" , " ?" , connection_name, 0); }
#line 11 "connect.pgc"


}


--
-=-=-=-=-=-=-<>-=-=-=-=-=-<>-=-=-=-=-=-<>-=-=-=-=-=-<>-=-=-=-=-=-=-
Ryan Mooney ryan (AT) pcslink (DOT) com
-=-=-=-=-=-=-><-=-=-=-=-=-><-=-=-=-=-=-><-=-=-=-=-=-><-=-=-=-=-=-=-

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html
--
Quote:
-=-=-=-=-=-=-<>-=-=-=-=-=-<>-=-=-=-=-=-<>-=-=-=-=-=-<>-=-=-=-=-=-=-
Ryan Mooney ryan (AT) pcslink (DOT) com
<-=-=-=-=-=-=-><-=-=-=-=-=-><-=-=-=-=-=-><-=-=-=-=-=-><-=-=-=-=-=-=->

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.