Re: Help with User-defined function in PostgreSQL with Visual C++

From: Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>
To: Esteban Zimanyi <estebanzimanyi(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Help with User-defined function in PostgreSQL with Visual C++
Date: 2010-09-26 04:35:41
Message-ID: AANLkTims069H1_B-fUxoX4Y0k-7emuBQGHU0MPvKoZc_@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Sep 26, 2010 at 12:56 AM, Esteban Zimanyi
<estebanzimanyi(at)gmail(dot)com> wrote:
> When I run the examples there is a server crash. I used both Visual
> C++ 2008 and 2005 for building the dll. I also used both PostgreSQL
> versions 8.4 and 9.0. All versions produce the same problem.
>
> Do you know how can I solve the problem ? Someone has a Visual C++
> solution that works that can send me ?

If you're developing your project as VC++ standalone project, codes
in tutorials and contrib modules don't work at all, because they
don't have __declspec(dllexport) for each function and variable to
be exported. They will work well as long as you use mingw or special
VC++ environment used to build the core.

I had the same problems before, and I wrote some hacks for VC++.
The codes in pg_reorg/lib in pgFoundry might be a help:
http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/reorg/pg_reorg/lib/reorg.c
http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/reorg/pg_reorg/lib/pgut/pgut-be.h

--
Itagaki Takahiro

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-09-26 05:51:32 pgsql: Still more tweaking of git_changelog.
Previous Message Kevin Grittner 2010-09-26 03:52:02 Re: Serializable Snapshot Isolation