Re: Retain dynamic shared memory segments for postmaster lifetime

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Retain dynamic shared memory segments for postmaster lifetime
Date: 2014-02-04 07:44:45
Message-ID: CAA4eK1K0=WJs4JiUFTuDOwMCd+R1fw+yYaUG==LosozZvYB01g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Feb 4, 2014 at 12:25 PM, Kyotaro HORIGUCHI
<horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
> Hello, Now I got workable dll thanks for your advice.
>
>> I think both the problems are related and the reason is that dsm_demo.dll
>> is not built properly.
>> Let us first try to solve your second problem, because I think if
>> that is solved, you will not face problem-1.
>
> Thank you for kindness. I got the situation after successfully
> getting correct dll by using .def file after your advice. cl
> needs __declspec(dllexport) in the symbol definitions to reveal
> them externally, without using .def file.
>
> PostgreSQL platform(?) seems offering a macro PGDLLEXPORT for
> such use. I suppose this should be used in extension module dlls
> to expose symbols, like this,
>
> - void _PG_init(void);
> - Datum dsm_demo_create(PG_FUNCTION_ARGS);
> - Datum dsm_demo_read(PG_FUNCTION_ARGS);
> ===
> + PGDLLEXPORT void _PG_init(void);
> + PGDLLEXPORT Datum dsm_demo_create(PG_FUNCTION_ARGS);
> + PGDLLEXPORT Datum dsm_demo_read(PG_FUNCTION_ARGS);
>
> # This hardly seems to be used commonly...

Yeah, for functions we mainly believe to export using .def file
only and so is the case for this module.
Anyway this is just a test module so if things works for you by
changing the above way, its fine. However I wonder why its not
generating .def file for you.
>
> I followed this instruction to make build environemnt,
>
> http://blog.2ndquadrant.com/compiling-postgresql-extensions-visual-studio-windows/
>
> And the change above enables us to build this module without .def file.

Okay, you can complete your test in the way with which you are able to
successfully build it.

With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2014-02-04 08:35:21 Re: narwhal and PGDLLIMPORT
Previous Message Craig Ringer 2014-02-04 07:39:50 Re: Row-security on updatable s.b. views