Adrian Klaver-4 wrote
> On 5/11/20 2:45 PM, TalGloz wrote:
>> Well I tried your steps, both Postgres 10 and 12 are in perfect running
>> conditions and were shut down using the "systemctl" command. When I
>> execute:
>>
>> /usr/pgsql-12/bin/pg_upgra
Well I tried your steps, both Postgres 10 and 12 are in perfect running
conditions and were shut down using the "systemctl" command. When I execute:
/usr/pgsql-12/bin/pg_upgrade --old-bindir=/usr/pgsql-10/bin/
--new-bindir=/usr/pgsql-12/bin/ --old-datadir=/var/lib/pgsql/10/data
--new-datadir=/var
Adrian Klaver-4 wrote
> On 5/3/20 3:11 PM, TalGloz wrote:
>> Adrian Klaver-4 wrote
>>> On 5/3/20 2:53 PM,
>>>
>>> Looks like you did not shutdown the 12 instance.
>>>
>>> --
>>> Adrian Klaver
>>
>>> adrian.klaver@
Adrian Klaver-4 wrote
> On 5/3/20 2:53 PM,
>
> Looks like you did not shutdown the 12 instance.
>
> --
> Adrian Klaver
> adrian.klaver@
This is weird because "systemctl staus postgresql-12.service" shows that the
service is dead.
Best regards,
TalGloz
--
Se
I'm in the process to update my Postgres 10 to 12 (it's my first server
upgrade). I've shutdown my Postgres 10 using "systemctl stop
postgresql-10.service" and "systemctl status postgresql-10.service" says:
Active: inactive (dead) since Sun 2020-05-03 22:51:46 CEST;
After that I've started the upg
Tom Lane-2 wrote
> TalGloz <
> glozmantal@
> > writes:
>> Andrew Gierth wrote
>>> I didn't see an easy way of disabling bitcode emission for a module,
>>> though I think that has been discussed before.
>
> After taking a quick look throug
Andrew Gierth wrote
>>>>>> "TalGloz" == TalGloz <
> glozmantal@
> > writes:
>
> TalGloz> Which is good, my seal_mean_cxx_v2.so being created and copied
> TalGloz> to /usr/pgsql-12/lib/. But right after that I get this and it
> TalG
Adrian Klaver-4 wrote
> On 5/2/20 4:03 PM, TalGloz wrote:
>
> Did you?
>
> In Makefile below I see:
>
> #PG_LDFLAGS= -L$(INCLUDE_SEAL_LIB) -lseal -pthread
> # Seal linker flags
> SEAL_LDFLAGS = -L$(INCLUDE_SEAL_LIB) -lseal -pthread
>
> --
> Adrian Klaver
&
Tom Lane-2 wrote
> TalGloz <
> glozmantal@
> > writes:
>> I dont understand why the output for Postgres 12
>> g++ -Wall -Wpointer-arith -Wendif-labels -Wmissing-format-attribute
>> -Wformat-security -fno-strict-aliasing -fwrapv -O2 -o seal_d
Adrian Klaver-4 wrote
> On 5/2/20 2:18 PM, Tom Lane wrote:
>> TalGloz <
> glozmantal@
> > writes:
>>> I dont understand why the output for Postgres 12
>>> g++ -Wall -Wpointer-arith -Wendif-labels -Wmissing-format-attribute
>>> -Wfor
Adrian Klaver-4 wrote
> On 5/2/20 1:09 PM, TalGloz wrote:
>> Adrian Klaver-4 wrote
>
>>
>> Yes, they were created when using make against Postgres 10 and I clean
>> them
>> every time when I try a different version of Postgres.
>
> Well I'm reachi
Adrian Klaver-4 wrote
> On 5/2/20 1:03 PM, TalGloz wrote:
>> Adrian Klaver-4 wrote
>>> On 5/2/20 12:39 PM, TalGloz wrote:
>>>> Adrian Klaver-4 wrote
>>>>> On 5/2/20 12:28 PM, TalGloz wrote:
>>>>>> I'm trying to upgrade
Adrian Klaver-4 wrote
> On 5/2/20 12:39 PM, TalGloz wrote:
>> Adrian Klaver-4 wrote
>>> On 5/2/20 12:28 PM, TalGloz wrote:
>>>> I'm trying to upgrade from PostgreSQL 10 to 12 and I need to compile
>>>> all
>>>> my
>>>&g
Adrian Klaver-4 wrote
> On 5/2/20 12:28 PM, TalGloz wrote:
>> I'm trying to upgrade from PostgreSQL 10 to 12 and I need to compile all
>> my
>> manually created C extension functions against PostrgreSQL 12 before
>> starting the upgrade process. I have this Mak
erver --->
/usr/pgsql-12/include/server (postgres.h is there)
I can't understand why it doesn't work.
TalGloz
--
Sent from: https://www.postgresql-archive.org/PostgreSQL-general-f1843780.html
Adrian Klaver-4 wrote
> On 5/1/20 3:39 PM, TalGloz wrote:
>> Adrian Klaver-4 wrote
>>> Why not compile them against 11?
>>>
>>> Then follow step 5) here:
>>>
>>> https://www.postgresql.org/docs/12/pgupgrade.html
>>
>> Step 5 does
Adrian Klaver-4 wrote
> Why not compile them against 11?
>
> Then follow step 5) here:
>
> https://www.postgresql.org/docs/12/pgupgrade.html
Step 5 doesn’t actually say how to compile them during the upgrade process
it just gives a warning about not to use "CREATE EXTENSION my_lib" because
this
I'm trying to upgrade my PostgreSQL form 10.2 to 11.7 (and eventually to
12.x), when I run:
/usr/pgsql-11/bin/pg_upgrade --old-bindir=/usr/pgsql-10/bin/
--new-bindir=/usr/pgsql-11/bin/ --old-datadir=/var/lib/pgsql/10/data
--new-datadir=/var/lib/pgsql/11/data --check
I get:
Checking for presence
> Tom's assumption is possibly correct. If the client does not have
> autocommit set then you need to explicitly commit the transaction.
I feel a little bit stupid , I forgot the use Work.commit(); in the function
on the client side!
Thanks for the help everybody!
Tal
--
Sent from: http://ww
> This is very strange, even if I comment all the loops in the function and
> leave only the INSERT INTO command the insert still doesn't happen.
Now If I execute the function locally in a query window like this:
SELECT public.seal_diff_benchmark_pgsql('YW55IGNhcm5hbCBwbGVhc3VyZQ==')
Then the
Tom Lane-2 wrote
> Maybe you're rolling back the transaction after leaving the function?
Why would it happen and how do I stop it if it is happening. I don't seem to
have anything in the code to cause it
Regards
Tal
--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f184378
> I was referring specifically to:
>
> https://www.postgresql.org/docs/10/static/plpgsql-errors-and-messages.html#PLPGSQL-STATEMENTS-RAISE
>
> I was going for a conceptual communication, not syntax.
>
> Though if you indeed get a syntax error then that precludes the "wrong
> object" theory.
I
> Add "RAISE ERROR" to the top function's BEGIN block and verify that the
> next time you run your calling query it indeed fails. I'm suspecting that
> the code you are iterating over is not the same code that is being
> executed
> (search_path dynamics probably).
Do you mean like this
BEGIN
RA
This is very strange, even if I comment all the loops in the function and
leave only the INSERT INTO command the insert still doesn't happen.
> The sealArray creation is modified, because I don't know how the function
> public.seal_diff_benchmark is defined.
>> public.seal_diff_benchmark(tempVar1
Charles Clavadetscher wrote
> Do you get any error?
The function executes perfectly and does what it's supposed to except of the
INSERT INTO part. I don't get any errors.
> Does the select deliver any result at all?
Yes, booth SELECT deliver everything they supposed to.
> If yes, is there ma
Hello,
I have this function that executes a C extention function in it and returns
a SETOF TEXT
CREATE OR REPLACE FUNCTION seal_diff_benchmark_pgsql(sealparams
CHARACTER VARYING) RETURNS SETOF TEXT AS $outputVar$
DECLARE
tempVar1 CHARACTER VARYING;
tempVar2 CHARACTER VARYI
Pavel Stehule wrote
> There are already prepared macros
>
> #define CStringGetTextDatum(s) PointerGetDatum(cstring_to_text(s))
> #define TextDatumGetCString(d) text_to_cstring((text *)
> DatumGetPointer(d))
Thanks for pointing out the macros, for some reason I've missed them.
Best regards,
Tal
It looks like changing the
elements[0] = CStringGetDatum(localT1.c_str());
elements[1] = CStringGetDatum(localT2.c_str());
to:
elements[0] = PointerGetDatum(cstring_to_text(localT1.c_str()));
elements[1] = PointerGetDatum(cstring_to_text(localT2.c_str()));
Solved the problem. If anyone thinks
Hello,
I'm having a small problem. The code works but the array cells don't hold
the whole length of *localT1* and *localT2* texts, I think it has something
to do with *int16 typlen* in my set parameters:
ArrayType *array;
Datum elements[2];
int16 typlen;
bool typbyval;
char typalign;
elements[0
I removed the flag --no-undefined and it was compiled and worked like a
charm. I needed the flag to spot the linker errors for linking with the
external *libseal.a* library.
As for my other question regarding the unused linker path
*-L"/usr/local/lib"*. I'm using Fedora 28 (RedHat) and in this dis
Yes, that was the problem and now everything works.
Thanks,
Tal
--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html
OK so I think I'm on the right way with this code and now my goal is to
return a text array (text[ ]) with 2 fields
extern "C" {
Datum text_array(PG_FUNCTION_ARGS){
// For text aka. character varying parameter
text *t1 = PG_GETARG_TEXT_PP(0);
text *t2 = PG_GETARG_TEXT_
Hello,
I want to return an vector of pairs using a C extension. This is a simple
code I have:
extern "C" {
Datum pair(PG_FUNCTION_ARGS){
// For text aka. character varying parameter
text *t1 = PG_GETARG_TEXT_PP(0);
text *t2 = PG_GETARG_TEXT_PP(1);
std::string loca
Hallo
Do you or anyone know why is it trying to link with -L/usr/lib64 path and
not -L/usr/local/lib as provided?
After recompiling the libseal.a with the -fPIC flag and copying it manually
from /usr/local/lib/ to /usr/lib64/ I get those errors:
g++ -Wl,--no-undefined -shared -o seal_diff_cpp.so
My CXXFLAGS has the -fPIC flag in it. As I understood from Tom Lane's previos
post, I have to recompile the libseal.a if the -fPIC flag or turn the
libseal.a into a libseal.so.
Best regars,
Tal
--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html
Hi,
Thanks for the reply but this question doesn't describe my problem. I've
asked the question again with much more detailed information about my
problem and got a solution, please see link below.
http://www.postgresql-archive.org/Linker-errors-while-creating-a-PostgreSQL-C-extension-function-td
Thanks, that did the trick. But now I'm getting this
g++ -Wl,--no-undefined -shared -o seal_diff_cpp.so seal_diff_cpp.o
-L/usr/pgsql-10/lib -L/usr/lib64 -Wl,--as-needed
-Wl,-rpath,'/usr/pgsql-10/lib',--enable-new-dtags -L/usr/local/lib -lseal
-pthread
/usr/bin/ld: /usr/lib64/libseal.a(bigpoly.cpp
I'm using Fedora 28 OS and I'll check it with PGXS. The funny thing is that
everything works when I comment every code line connected to the SEAL
library.
The cppcodec library is also an external library installed to
/usr/local/include/cppcodec like the SEAL library.
Regards,
Tal
--
Sent from:
I'll try it later when I'm home. Is there a reason that you are linking like
this
$(CXX) -Wl,--no-undefined -shared -o seal_diff_cpp.so $(LDFLAGS) $(LDLIBS)
seal_diff_cpp.o
And not like this?
$(CXX) -Wl,--no-undefined -shared -o seal_diff_cpp.so seal_diff_cpp.o
$(LDFLAGS) $(LDLIBS)
--
Sent f
No, they still don't appear there and same errors are shown.
--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html
OK, I've changed my line to
LDFLAGS = -L$(INCLUDE_SEAL_LIB) -lseal -lpthread
In my Makefile this command is written like this (line numbers are just for
orientation)
1: seal_diff_cpp.so: seal_diff_cpp.o
2:$(CXX) -Wl,--no-undefined -shared -o seal_diff_cpp.so
seal_diff_cpp.o $(LDFLAGS)
3:
Do you mean this command:
seal_diff_cpp.so: seal_diff_cpp.o
$(CXX) -Wl,--no-undefined -shared -o seal_diff_cpp.so
seal_diff_cpp.o $(LDFLAGS)
If yes then the -lseal is added with the $(LDFLAGS) at the end of the
command.
--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general
Hello,
*I have this code for my C extension function.
*
xtern "C" { // C Headers must be inside exter "C" { } block.
#include
#include
#include
#include
#include
#include
#include
#include
PG_MODULE_MAGIC;
}
// CPP Header must be outside extern "C" { } block.
#include
#include
#includ
Hi,
If I have an external library that I install using make install into the
/usr/local/include/libraryname path by default and I want to include it in a
C extension, the Makefile for the .so file includes the headers in
/usr/local/include/libraryname path.
Can I use #include when writing C/CPP
OK It worked. This is how I did it, hopefully it is right
extern "C" {
#include
#include
#include
#include
#include
#include
#include
#include
PG_MODULE_MAGIC;
}
#include
#include
#include
#include
#include // external compiled c++ library linked on running
'make'
extern "C" {
Dat
Let me see if I understood you correctly. I cant have a code like this:
extern "C" {
int sum_of_numbers(){
std::vector numbers {23, 445, 64};
int sum = 0;
for (auto &item : numbers){
sum += item;
}
I did it with the macros
extern "C" {
Datum sum_of_numbers(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(sum_of_numbers);
}
But now my compiler throws some other errors when running make:
g++ --std=c++17 -fPIC -Wall -Werror -g3 -O0 -o myfunc.o -c myfunc.cpp
-I/usr/pgsql-10/include/server -L"/usr/local/
OK now I have this code:
1: extern "C" { // The C header should go here
2: #include
3: #include
4: #include
5: #include
6: #include
7: #include
8: #include
9: #include
10:
11: PG_MODULE_MAGIC;
12: }
13:
14: // CPP header without extern "C"
15: #include
16: #include
1
Hi,
I've searched information about my problem in the archives and on the
internet, but it didn't help. I have this small myfunc.cpp
1: #include
2: #include
3: #include
4: #include
5: #include
6: #include
7: #include
8: #include
9: #include
10: #include
11: #include
1
49 matches
Mail list logo