From unixos@prodigy.net.mx Sun Dec 26 18:24:09 2004 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 2F0653F6A7D for ; Sun, 26 Dec 2004 18:24:09 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 92714-08 for ; Sun, 26 Dec 2004 18:24:01 +0000 (GMT) Received: from smtp.prodigy.net.mx (nlpproxy01.prodigy.net.mx [148.235.52.21]) by svr1.postgresql.org (Postfix) with ESMTP id AB9513F6AB5 for ; Sun, 26 Dec 2004 18:24:00 +0000 (GMT) Received: from smtp.prodigy.net.mx (nlpproxy01 [148.235.52.21]) by smtp.prodigy.net.mx (iPlanet Messaging Server 5.2 HotFix 2.01 (built Aug 26 2004)) with ESMTP id <0I9C00AYYDR2BF@smtp.prodigy.net.mx>; Sun, 26 Dec 2004 12:23:27 -0600 (CST) Received: from progs01laptop(dsl-201-135-73-67.prod-infinitum.com.mx [201.135.73.67]) by smtp.prodigy.net.mx(iPlanet Messaging Server 5.2 HotFix 2.01 (built Aug 26 2004))with ESMTP id <0I9C00AKKDQWER@smtp.prodigy.net.mx>; Sun, 26 Dec 2004 12:23:26 -0600 (CST) Date: Sun, 26 Dec 2004 11:23:45 -0700 From: Jose Mendoza Subject: Function in C++ To: pgsql-sql@postgresql.org Message-id: <0I9C00AKWDR2ER@smtp.prodigy.net.mx> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Mailer: Microsoft Office Outlook, Build 11.0.5510 Content-type: multipart/alternative; boundary="----=_NextPart_000_0000_01C4EB3D.5D4BFD10" Thread-index: AcTrcd8AJnjf0vl6QsCWIhrtVA5t9Q== X-imss-version: 2.012 X-imss-result: Passed X-imss-scores: Clean:8.78633 C:20 M:0 S:5 R:5 X-imss-settings: Baseline:3 C:2 M:2 S:2 R:2 (0.5000 1.0000) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=2.243 tagged_above=0 required=5 tests=DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, DNS_FROM_RFC_WHOIS, HTML_MESSAGE X-Spam-Level: ** X-Archive-Number: 200412/166 X-Sequence-Number: 19786 This is a multi-part message in MIME format. ------=_NextPart_000_0000_01C4EB3D.5D4BFD10 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit I would like to have, only if it is possible, a small example of how can be that done. I have this problem now because I have a very light interface using the ODBC and with the same code I can connect to Postgresql (servers Linux) and SQLserver (servers Windows). And the libpq++ works in C++ if I reject the idea of use ODBC. Any help will be appreciated. Thans Jose Mendoza unixos@prodigy.net.mx ------=_NextPart_000_0000_01C4EB3D.5D4BFD10 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

 

I would like to have, only if it is possible, a small example of how can be that done. I have this problem now because I have = a very light interface using the ODBC and with the same code I can connect to Postgresql (servers Linux) and SQLserver (servers Windows). And the = libpq++ works in C++ if I reject the idea of use = ODBC.

 

Any help will be = appreciated.

 

Thans

 

Jose Mendoza

unixos@prodigy.net.mx

 

 

 

------=_NextPart_000_0000_01C4EB3D.5D4BFD10-- From tjo@acm.org Sat Jan 1 19:20:44 2005 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E3ACC3A1D13 for ; Sat, 1 Jan 2005 19:20:44 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 05480-05 for ; Sat, 1 Jan 2005 19:20:39 +0000 (GMT) Received: from fed1rmmtao07.cox.net (fed1rmmtao07.cox.net [68.230.241.32]) by svr1.postgresql.org (Postfix) with ESMTP id C15143A2183 for ; Sat, 1 Jan 2005 19:20:38 +0000 (GMT) Received: from [192.168.1.202] (really [68.111.226.8]) by fed1rmmtao07.cox.net (InterMail vM.6.01.04.00 201-2131-117-20041022) with ESMTP id <20050101192037.DYEA21886.fed1rmmtao07.cox.net@[192.168.1.202]>; Sat, 1 Jan 2005 14:20:37 -0500 Message-ID: <41D6F804.9060703@acm.org> Date: Sat, 01 Jan 2005 11:20:36 -0800 From: TJ O'Donnell Reply-To: tjo@acm.org User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jose Mendoza Cc: pgsql-sql@postgresql.org Subject: Re: Function in C++ References: <0I9C00AKWDR2ER@smtp.prodigy.net.mx> In-Reply-To: <0I9C00AKWDR2ER@smtp.prodigy.net.mx> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200501/1 X-Sequence-Number: 19789 All I do is write a c interface with postgresql, using the standard method described in the documentation. There are example in the src code tree, too. The only "trick" is to declare my c++ functions to be callable by c, like in this example: extern "C" int oe_smarts_match(char *smi, char *sma) { .c++ code ... } Then my c interface code calls oe_smarts_match. I hope this helps. Let me know if you need more details or examples. TJ Jose Mendoza wrote: > > > I would like to have, only if it is possible, a small example of how can > be that done. I have this problem now because I have a very light > interface using the ODBC and with the same code I can connect to > Postgresql (servers Linux) and SQLserver (servers Windows). And the > libpq++ works in C++ if I reject the idea of use ODBC. > > > > Any help will be appreciated. > > > > Thans > > > > Jose Mendoza > > unixos@prodigy.net.mx > > > > > > >