Re: compiling PL/pgSQL plugin with C++

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Тарасов Георгий Витальевич <Tarasov-G(at)gaz-is(dot)ru>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: compiling PL/pgSQL plugin with C++
Date: 2019-05-30 15:54:24
Message-ID: 51937.1559231664@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

[ redirecting to -hackers ]

=?koi8-r?B?9MHSwdPP1yDnxc/Sx8nKIPfJ1MHM2MXXyd4=?= <Tarasov-G(at)gaz-is(dot)ru> writes:
> I'm working on development of some PL/pgSQL plugin.
> The smaller part of my code is written on C.
> It's a standard extension code for integration with fmgr (_PG_init ...)
> But bigger part of the code is written on C++.
> And here I need declarations of internal PL/pgSQL structs from plpgsql.h

So ... that's supposed to work, because we have a test script that
verifies that all our headers compile as C++.

Or I thought it was "all", anyway. Closer inspection shows that it's
not checking src/pl. Nor contrib.

I propose that we change src/tools/pginclude/cpluspluscheck so that
it searches basically everywhere:

-for f in `find src/include src/interfaces/libpq/libpq-fe.h src/interfaces/libpq/libpq-events.h -name '*.h' -print | \
+for f in `find src contrib -name '*.h' -print | \

However, trying to run that, I find that plpython and plperl are both
seriously in violation of the project convention that headers should
compile standalone. It looks like most of their headers rely on an
assumption that the calling .c file already included the Python or
Perl headers respectively.

Anybody object to me reshuffling the #include's to make this pass?
I propose doing that for HEAD only, although we should back-patch
George's fix (and any other actual C++ problems we find).

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Will Hartung 2019-05-30 17:11:36 Re: Questions about btree_gin vs btree_gist for low cardinality columns
Previous Message Тарасов Георгий Витальевич 2019-05-30 15:14:01 compiling PL/pgSQL plugin with C++

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2019-05-30 16:21:59 Re: error messages in extended statistics
Previous Message Marko Tiikkaja 2019-05-30 15:54:18 Re: New committer: David Rowley