Received: from u1.abs.net (root@u1.abs.net [207.114.0.131]) by hub.org (8.8.8/8.7.5) with ESMTP id NAA07909 for ; Fri, 21 Aug 1998 13:15:36 -0400 (EDT) Received: from insightdist.com (root@localhost) by u1.abs.net (8.9.0/8.9.0) with UUCP id NAA16142 for pgsql-interfaces@postgresql.org; Fri, 21 Aug 1998 13:00:10 -0400 (EDT) Received: from ceodev by insightdist.com (AIX 3.2/UCB 5.64/4.03) id AA54509; Fri, 21 Aug 1998 12:44:09 -0400 Received: from byronn by ceodev (AIX 4.1/UCB 5.64/4.03) id AA47540; Fri, 21 Aug 1998 12:44:09 -0400 Message-Id: <35DDA3D3.D39F5846@insightdist.com> Date: Fri, 21 Aug 1998 12:44:03 -0400 From: Byron Nikolaidis X-Mailer: Mozilla 4.05 [en] (Win95; I) Mime-Version: 1.0 To: "Thomas G. Lockhart" Cc: Gerald Gryschuk , Postgres Interfaces Mailing List Subject: Re: [INTERFACES] iodbc interface on Unix References: <35D99896.DFB21123@alumni.caltech.edu> <35D9D132.4DE6ACB8@insightdist.com> <86iujpr0qh.fsf@avd.gcom.ru> <35DAD65D.34165A2F@insightdist.com> <35DAE850.93FC000C@alumni.caltech.edu> <35DB06BB.16F5D38D@alumni.caltech.edu> <35DB1A0A.53F5BD81@insightdist.com> <35DB2F55.CF1072DA@scf.sk.ca> <35DB3107.894B0E3C@insightdist.com> <35DD97AF.30F23F27@alumni.caltech.edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Thomas G. Lockhart wrote: > Hi Byron. OK, I seem to have a full-featured ODBC interface running > under Unix. Been able to do table selects and updates, and I understand > how the .odbc.ini files should look. It turns out _none_ of the problems > I've had were with your fundamental code (e.g. all socket handshakes > worked without change!) but instead were due to obscure differences in > our compilation and linking environments. > > There are a few things to figure out to reintegrate with your main tree: > > 1) I have a Makefile which integrates with the Postgres distribution. I > assume that you don't want or need it in your primary distribution, > right? So I'll commit it to the Postgres distribution but you might want > to ignore it... > There was already a "Makefile.unx" file in the distribution. Is that the file (or some part thereof) you are using? To answer your question, yes it should be in the distribution. I do include it even in the postsrc.zip archive, along with the windows makefile psqlodbc.mak. But the psqlodbc.mak file is not in the official source whereas the "Makefile.unx" file is. > 2) The Unix environment uses dynamic linking from the ODBC driver > manager to the psqlodbc driver. On Unix, calls from within psqlodbc to > other routines which are local to psqlodbc actually get linked back to > the ODBC manager rather than staying local. This is not what is > intended, but the behavior makes sense. The way around this is to have > local names for the routines, and jump through the public names when > calling them externally, and call the internal names directly when > within postodbc. I've found a way to _not_ require this internal jump > when #ifdef UNIX is false. The mechanism I'm using requires a macro > defined: > > #ifdef UNIX > #define INTERNAL(f) _##f > #else > #define INTERNAL(f) f > #endif > > Can you check that this no-op macro works for you when subroutine names > are inside this INTERNAL() macro? For example, in bind.c, change one of > the internal calls to SQLAllocStmt() from something like > result = SQLAllocStmt( self, &hstmt); > to > result = INTERNAL(SQLAllocStmt)( self, &hstmt); > > If your C compiler/preprocessor supports this, then we're OK. The > non-Unix code won't have to carry the overhead of these extra calls... > Yes, this works. BUT, I don't see the real benefit. OK, so the internal calls will now have the original behavior for Windows, which for all I know, might not be as fast as just calling the internal function. Internal calls aren't that intensive anyway so I don't see any real savings here. BUT, external calls from the driver manager will now have to go through this thin wrapper layer (SQLGetData --->_SQLGetData), which is a small performance loss, especially on a call to say, SQLGetData, which could possibly be called a million times in a session for big data access. I don't have a problem with these wrappers but the real benefit for Windows, would be if the external calls didn't have to go through the wrapper layer. Therefore, I would rather not have this INTERNAL macro and simply call the _SQLxxx functions internally. > 3) Many, but not all, of the source code files have DOS-specific EOL > characters. I'd like to strip those out of the code which is sitting on > Unix boxes, and have them correct when sitting on your DOS machines too. > Can we transfer files using FTP ascii transfers to fix the EOL problems > in the future? Or is there another way which will get this fixed up?? In > the meantime I will clean up all the files I have, and then can get them > to you via the Postgres web site. > OK. I do transfer files to Postgresql.org using ftp ascii. Just the postsrc.zip distribution would have dos crap in it. > 4) I would like to add a couple of keyword parameters to the .odbc.ini > configuration file: CommLog and Debug were previously allowed only in > the /etc/odbcinit.ini file. Is it OK to add them? Are there > considerations which would make this a bad idea? > I think these log type parameters belong on the driver level as they are now, not per datasource. OR did I misunderstand your question? > 5) I've made the odbc.ini file reader case insensitive and more > resilient to embedded whitespace (e.g. keywords no longer have to start > in the first column). As in the previous item, are there considerations > which would make this a bad idea? > This sounds fine. Byron