Force Commit

2020-02-05 Thread İlyas Derse
I'm writing to you about Commit. I want to do force commit query even if I have exception. It's like : CREATE OR REPLACE PROCEDURE public."test"() LANGUAGE 'plpgsql' AS $BODY$ DECLARE "a" integer ; DECLARE "b" integer ; BEGIN "a" = 1; "b" = 0; BEGIN raise notice 'hata'; update public."

@@TRANCOUNT ?

2020-01-22 Thread İlyas Derse
What's Prostgres' equivalent of select @@trancount ? Do you have an idea ?

Is there a GoTo ?

2020-01-16 Thread İlyas Derse
In this function I have to GOTO to a label1, but GOTO keyword is not working, can you please help me in getting the way from which I am able to jump from a particular code to label. Thanks... CREATE OR REPLACE FUNCTION test(i integer) RETURNS integer AS $$BEGINIF i<0 THEN RETURN i + 1;ELSE GOTO

WaitForMultipleObjects in C Extension

2020-01-13 Thread İlyas Derse
Hi guys I need your experiences. I made an Extension in C. When I stop the query on PostgreSQL,I want to control my extension's result with use cases in C.So I think , I should use WaitForMultipleObjects. Is there a like a SignalObjectHandle() ? By the way I'm using Windows. Thanks...

Re: Writing Postgres Extensions in C on Windows

2020-01-08 Thread İlyas Derse
Thanks, I'll check it out. Thomas Munro , 7 Oca 2020 Sal, 23:56 tarihinde şunu yazdı: > On Wed, Jan 8, 2020 at 4:32 AM İlyas Derse wrote: > > I want to register C code to PostgreSql on Windows. So I think, I have > to make a extension for PostgreSql. But I did not find to writt

Writing Postgres Extensions in C on Windows

2020-01-07 Thread İlyas Derse
I want to register C code to PostgreSql on Windows. So I think, I have to make a extension for PostgreSql. But I did not find to written extension on windows. Do you have an idea ? Thanks ...

How can I set a timeout for a locked table in Function ?

2020-01-03 Thread İlyas Derse
CREATE OR REPLACE FUNCTION public."testlock"() RETURNS TABLE ( id integer, name character varying, state integer, owner character varying ) LANGUAGE 'plpgsql' AS $BODY$ BEGIN

Is there an equivalent to sp_getapplock, sp_releaseapplock in PostgreSql?

2019-12-13 Thread İlyas Derse
In MSSQL I am using sp_getapplock, sp_releaseapplock. How can I achieve the same functionality in PostgreSql?

Insert Table from Execute String Query

2019-12-06 Thread İlyas Derse
I need to insert temp table from execute string query. How can I do ? I'm trying like that but not working. CREATE OR REPLACE FUNCTION public.testdyn ( x integer ) RETURNS TABLE ( id bigint, text character varying(4000) ) AS $$ DECLARE mysql TEXT; BEGIN crea

Call Stored Procedure with inout parameters in c#

2019-11-25 Thread İlyas Derse
I tried with inout parameters but it did not work correctly. here is my procedure : CREATE OR REPLACE PROCEDURE public.testing ( INOUT x int ) LANGUAGE 'plpgsql' AS $$ BEGIN x := x * 3; END ; $$; my C# code: public void myMethod2() { CRUD.con.Open(); int a = 5

Return Table in StoredProceure/Function

2019-11-20 Thread İlyas Derse
How can I return table in Stored Procedure ? I can do it in function but I have inout parameters.So I can not create in function. What can I do this case ? I guess,It should be like for function : CREATE or REPLACE FUNCTION public."test" (INOUT "x" integer, INOUT "y" text) RETURNS TABLE ("id" i

INOUT PARAMETERS WITH RETURN TABLES IN FUNCTION

2019-11-08 Thread İlyas Derse
I'm trying to migration to PostgreSql from SQL Server. I have Stored Procedures what have output parameters and return tables. How can i do both together. Its like ; CREATE or replace FUNCTION public."test" (INOUT "x" integer, INOUT "y" character varying(36)) RETURNS TABLE ( "id" integer, "fil

SQL SERVER migration to PostgreSql

2019-11-07 Thread İlyas Derse
I'm trying to migration to PostgreSql from SQL Server. I have Stored Procedures what have output parameters and returning tables.But you know what, we can not returning tables in stored procedures in PostgreSql and we can not use output parameters in functions in PostgreSql. So i did not find to s