postgresql/contrib/mSQL-interface
Bruce Momjian ee85595d46 > Please find enclose a submission to fix these problems.
>
> The patch adds missing the "libpgport.a" file to the installation under
> "install-all-headers". It is needed by some contribs. I install the
> library in "pkglibdir", but I was wondering whether it should be "libdir"?
> I was wondering also whether it would make sense to have a "libpgport.so"?
>
> It fixes various macros which are used by contrib makefiles, especially
> libpq_*dir and LDFLAGS when used under PGXS. It seems to me that they are
> needed to
>
> It adds the ability to test and use PGXS with contribs, with "make
> USE_PGXS=1". Without the macro, this is exactly as before, there should be
> no difference, esp. wrt the vpath feature that seemed broken by previous
> submission. So it should not harm anybody, and it is useful at least to me.
>
> It fixes some inconsistencies in various contrib makefiles
> (useless override, ":=" instead of "=").

Fabien COELHO
2004-08-20 20:13:10 +00:00
..
Makefile > Please find enclose a submission to fix these problems. 2004-08-20 20:13:10 +00:00
mpgsql.c pgindent run. 2002-09-04 20:31:48 +00:00
README.mpgsql

Hello! :)

(Sorry for my english. But if i wrote in portuguese, you wouldn't
 understand nothing. :])

	I found it's the right place to post this. I'm a newcomer in these
lists. I hope i did it right. :]

<BOREDOM>
	When i started using SQL, i started with mSQL. I developed a lot
of useful apps for me and my job with C, mainly because i loved it's
elegant, simple api. But for a large project i'm doing in these days, i
thought is was not enough, because it felt a lot of features i started to
need, like security and subselects. (and it's not free :))
	So after looking at the options, choose to start again with
postgres. It offered everything that i needed, and the documentation is
really good (remember me to thank the one who wrote'em).
	But for my little apps, i needed to start porting them to libpq.
After looking at pq's syntax, i found it was better to write a bridge
between the mSQL api and libpq. I found that rewriting the libmsql.a
routines that calls libpq would made things much easier. I guess the
results are quite good right now.
</BOREDOM>

	Ok. Lets' summarize it:

	mpgsql.c is the bridge. Acting as a wrapper, it's really good,
since i could run mSQL. But it's not accurate. Some highlights:

	CONS:
	* It's not well documented 
		(this post is it's first documentation attempt, in fact);
	* It doesn't handle field types correctly. I plan to fix it,
	  if people start doing feedbacks;
	* It's limited to 10 simultaneous connections. I plan to enhance
	  this, i'm just figuring out;
	* I'd like to make it reentrant/thread safe, although i don't
	  think this could be done without changing the API structure;
	* Error Management should be better. This is my first priority
          now;
	* Some calls are just empty implementations.

	PROS:
	* the mSQL Monitor runs Okay. :]
	* It's really cool. :)
	* Make mSQL-made applications compatible with postgresql just by
	  changing link options.
	* Uses postgreSQL. :]
	* the mSQL API it's far easier to use and understand than libpq.
          Consider this example:

#include "msql.h"

void main(int argc, char **argv, char **envp) {
   int sid;
	
   sid = msqlConnect(NULL); /* Connects via unix socket */

   if (sid >= 0) {
      m_result *rlt;
      m_row *row;
      msqlSelectDB(sid, "hosts");
      if (msqlQuery(sid, "select host_id from hosts")) {
	 rlt = msqlStoreResult();
         while (row = (m_row*)msqlFetchRow(rlt)) 
            printf("hostid: %s\n", row[0]);
         msqlFreeResult(rlt);
      }
      msqlClose(sid);
   }
}

	I enclose mpgsql.c inside. I'd like to maintain it, and (maybe, am
i dreaming) make it as part of the pgsql distribution. I guess it doesn't
depends on me, but mainly on it's acceptance by its users.

	Hm... i forgot: you'll need a msql.h copy, since it's copyrighted
by Hughes Technologies Pty Ltd. If you haven't it yes, fetch one
from www.hughes.com.au.

	I would like to catch users ideas. My next goal is to add better
error handling, and to make it better documented, and try to let relshow
run through it. :)

	done. Aldrin Leal <aldrin@americasnet.com>