Thread: New ecgp code problem.
Hi All, I'm getting a SEGV error when testing ecpg using the perftest,or any other, example program. I have tracked this down to a call to PQfinish() in ECPGfinish() that occurs before any connection is established. bool ECPGfinish() { if (simple_connection != NULL) { ECPGlog("ECPGfinish: finishing.\n"); PQfinish(simple_connection); } else ECPGlog("ECPGfinish: called an extra time.\n"); return true; } A test is made here for simple_connection != NULL. If I apply the following patch all is OK. Keith. *** src/interfaces/ecpg/lib/ecpglib.c.orig Tue Feb 17 22:01:00 1998 --- src/interfaces/ecpg/lib/ecpglib.c Tue Feb 17 22:01:30 1998 *************** *** 24,30 **** #include <libpq-fe.h> #include <libpq/pqcomm.h> ! static PGconn *simple_connection; static int simple_debug = 0; static FILE *debugstream = NULL; static int committed = true; --- 24,30 ---- #include <libpq-fe.h> #include <libpq/pqcomm.h> ! static PGconn *simple_connection = NULL; static int simple_debug = 0; static FILE *debugstream = NULL; static int committed = true;
Keith Parks writes: > If I apply the following patch all is OK. Thanks. It's already in CVS it seems. Are you able to execute programs against v6.3? I cannot even create a user so I only can test my changes my manually inspecting the C file right now. Michael -- Dr. Michael Meskes, Project-Manager | topsystem Systemhaus GmbH meskes@topsystem.de | Europark A2, Adenauerstr. 20 meskes@debian.org | 52146 Wuerselen Go SF49ers! Go Rhein Fire! | Tel: (+49) 2405/4670-44 Use Debian GNU/Linux! | Fax: (+49) 2405/4670-10
Hi, Things were working upto a point when I was playing yesterday. The perftest seemed to run OK The test2 example ran but did not display the varchar (name) field. I'm afraid I've not got very far debugging. Keith. Michael Meskes <meskes@topsystem.de> > Keith Parks writes: > > If I apply the following patch all is OK. > > Thanks. It's already in CVS it seems. Are you able to execute programs > against v6.3? I cannot even create a user so I only can test my changes my > manually inspecting the C file right now. >
Do you mean you didn't get any output? Or you got just the numbers? If you didn't get anything that's the old problem and I believe the same problem holds for ODBC (Julie?). The first fetch returns no row, so the program ends. Unfortunately I haven't changed anything I expect to be able to cause that problem. It seems to be a backend/library problem. Anyway, which version are you using? I cannot connect to a database since last week or so. I tried re-initdb'ing it but get a seg fault in the backend when doing a createuser. So my only chance of testing right now is to manually inspect the code created. Michael -- Dr. Michael Meskes, Project-Manager | topsystem Systemhaus GmbH meskes@topsystem.de | Europark A2, Adenauerstr. 20 meskes@debian.org | 52146 Wuerselen Go SF49ers! Go Rhein Fire! | Tel: (+49) 2405/4670-44 Use Debian GNU/Linux! | Fax: (+49) 2405/4670-10 > -----Original Message----- > From: Keith Parks [SMTP:emkxp01@mtcc.demon.co.uk] > Sent: Wednesday, February 18, 1998 8:28 PM > To: meskes@topsystem.de > Cc: pgsql-hackers@postgresql.org > Subject: Re: New ecgp code problem. > > Hi, > > Things were working upto a point when I was playing yesterday. > > The perftest seemed to run OK > The test2 example ran but did not display the varchar (name) field. > > I'm afraid I've not got very far debugging. > > Keith. > > >
pg_user permissions problem (Was: Re: [HACKERS] RE: New ecgp code problem.)
From
The Hermit Hacker
Date:
On Thu, 19 Feb 1998, Meskes, Michael wrote: > Do you mean you didn't get any output? Or you got just the numbers? If > you didn't get anything that's the old problem and I believe the same > problem holds for ODBC (Julie?). The first fetch returns no row, so the > program ends. Unfortunately I haven't changed anything I expect to be > able to cause that problem. It seems to be a backend/library problem. I spent time with Julie last night working on this, and the problem comes back down to "pg_user: Permission Denied"... I think this is a high priority problem, since it affects so many things. What is the chance of (how hard would it be to?) having a hard coded view setup that overrides the permissions lock on pg_user? At what point is the lock implemented, software level, or file system? All we would really need was: create view all_users as select usename,usesysid from pg_user; Which psql/odbc/ecgp/jdbc could call instead of what its doing now...
Re: pg_user permissions problem (Was: Re: [HACKERS] RE: New ecgp code problem.)
From
Michael Meskes
Date:
The Hermit Hacker writes: > What is the chance of (how hard would it be to?) having a hard > coded view setup that overrides the permissions lock on pg_user? At what > point is the lock implemented, software level, or file system? I wasn't able to read data from a DB that I created with the very same user. But I was able to connect, insert data etc. Why was that possible? > All we would really need was: > > create view all_users as select usename,usesysid from pg_user; > > Which psql/odbc/ecgp/jdbc could call instead of what its doing > now... ecpg doesn't call anything like that. All I use is some PQ... functions. No direct access to whatever user permission system we have. So does this have to be changed in libpq? Michael -- Dr. Michael Meskes, Project-Manager | topsystem Systemhaus GmbH meskes@topsystem.de | Europark A2, Adenauerstr. 20 meskes@debian.org | 52146 Wuerselen Go SF49ers! Go Rhein Fire! | Tel: (+49) 2405/4670-44 Use Debian GNU/Linux! | Fax: (+49) 2405/4670-10
Re: pg_user permissions problem (Was: Re: [HACKERS] RE: New ecgp code problem.)
From
Bruce Momjian
Date:
> I spent time with Julie last night working on this, and the > problem comes back down to "pg_user: Permission Denied"... > > I think this is a high priority problem, since it affects so many > things. > > What is the chance of (how hard would it be to?) having a hard > coded view setup that overrides the permissions lock on pg_user? At what > point is the lock implemented, software level, or file system? > I believe the only way to fix it at this point is to remove the REVOKE pg_user from initdb, and add a check in user.c to make sure the permissions on pg_user are not NULL if they try and use passwords. -- Bruce Momjian maillist@candle.pha.pa.us
Hi, The problem is just the missing name column. I've just trashed my last build, which passed the regression tests perfectly (SPARC/Linux on an IPX), to do a fresh build from CVS. Once this is complete I'll do some more tests. Basically the output looks something like. was born 19661202 (age=32) was born 19881202 (age=54) etc. etc. ^^^^^^^^ Just a blank field!! Maybe it's something in the structure handling? Keith. "Meskes, Michael" <meskes@topsystem.de> > > Do you mean you didn't get any output? Or you got just the numbers? If > you didn't get anything that's the old problem and I believe the same > problem holds for ODBC (Julie?). The first fetch returns no row, so the > program ends. Unfortunately I haven't changed anything I expect to be > able to cause that problem. It seems to be a backend/library problem. > > Anyway, which version are you using? I cannot connect to a database > since last week or so. I tried re-initdb'ing it but get a seg fault in > the backend when doing a createuser. So my only chance of testing right > now is to manually inspect the code created. > > Michael > > -- > Dr. Michael Meskes, Project-Manager | topsystem Systemhaus GmbH > meskes@topsystem.de | Europark A2, Adenauerstr. 20 > meskes@debian.org | 52146 Wuerselen > Go SF49ers! Go Rhein Fire! | Tel: (+49) 2405/4670-44 > Use Debian GNU/Linux! | Fax: (+49) 2405/4670-10 > > > -----Original Message----- > > From: Keith Parks [SMTP:emkxp01@mtcc.demon.co.uk] > > Sent: Wednesday, February 18, 1998 8:28 PM > > To: meskes@topsystem.de > > Cc: pgsql-hackers@postgresql.org > > Subject: Re: New ecgp code problem. > > > > Hi, > > > > Things were working upto a point when I was playing yesterday. > > > > The perftest seemed to run OK > > The test2 example ran but did not display the varchar (name) field. > > > > I'm afraid I've not got very far debugging. > > > > Keith. > > > > > >
Keith Parks writes: > Hi, > > The problem is just the missing name column. I think I know the problem. I will send a patch later (again) but I cannot test it myself as I still cannot create a user. Hmm, maybe I should try as postgres user. Michael -- Dr. Michael Meskes, Project-Manager | topsystem Systemhaus GmbH meskes@topsystem.de | Europark A2, Adenauerstr. 20 meskes@debian.org | 52146 Wuerselen Go SF49ers! Go Rhein Fire! | Tel: (+49) 2405/4670-44 Use Debian GNU/Linux! | Fax: (+49) 2405/4670-10