Re: Executing a Function with an INSERT INTO command fails

2018-08-29 Thread TalGloz
> 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

Re: Executing a Function with an INSERT INTO command fails

2018-08-29 Thread Charles Clavadetscher
Hi > On 29.08.2018, at 19:45, TalGloz wrote: > > >> 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_d

RE: Executing a Function with an INSERT INTO command fails

2018-08-29 Thread TalGloz
> 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

Re: Executing a Function with an INSERT INTO command fails

2018-08-29 Thread TalGloz
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

Re: Executing a Function with an INSERT INTO command fails

2018-08-29 Thread TalGloz
> 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

Re: Executing a Function with an INSERT INTO command fails

2018-08-29 Thread David G. Johnston
On Wed, Aug 29, 2018 at 9:47 AM, TalGloz wrote: > > > 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 > > (s

Re: Executing a Function with an INSERT INTO command fails

2018-08-29 Thread TalGloz
> 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

Re: Executing a Function with an INSERT INTO command fails

2018-08-29 Thread David G. Johnston
On Wed, Aug 29, 2018 at 9:27 AM, TalGloz wrote: > 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. > Add "RAISE ERROR" to the top function's BEGIN block and verify that the next time you run your calli

Re: Executing a Function with an INSERT INTO command fails

2018-08-29 Thread Tom Lane
TalGloz writes: > 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. Maybe you're rolling back the transaction after leaving the function? regards, tom lane

RE: Executing a Function with an INSERT INTO command fails

2018-08-29 Thread TalGloz
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

RE: Executing a Function with an INSERT INTO command fails

2018-08-29 Thread Charles Clavadetscher
Hi > -Original Message- > From: TalGloz [mailto:glozman...@gmail.com] > Sent: Mittwoch, 29. August 2018 13:22 > To: pgsql-gene...@postgresql.org > Subject: RE: Executing a Function with an INSERT INTO command fails > > Charles Clavadetscher wrote > > Do

RE: Executing a Function with an INSERT INTO command fails

2018-08-29 Thread TalGloz
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

RE: Executing a Function with an INSERT INTO command fails

2018-08-29 Thread Charles Clavadetscher
Hi > -Original Message- > From: TalGloz [mailto:glozman...@gmail.com] > Sent: Mittwoch, 29. August 2018 11:12 > To: pgsql-gene...@postgresql.org > Subject: Executing a Function with an INSERT INTO command fails > > Hello, > > I have this function that executes a C extention function in i