Posts

Showing posts with the label npgsql

npgsql search_path not working

npgsql search_path not working I've a script like the following: SET search_path = MySchema; INSERT INTO MyTable() values () MyTable is actually created in MySchema, so if I change the script to INSERT INTO MySchema.MyTable() values () It works Now I'm generating some SQL files to recreate a database structure, so we have the scripts generated with "SET search_path = MySchema;" Is there a way to make this work? Using NPGSQL version 3.0.4.0 Apparently the search path can be defined in the connection string: "Search Path Sets the schema search path." See "Connection String Parameters" - "Misc". Maybe this is an option for you? – sticky bit Jun 30 at 2:37 Thank you, it helped to sort the issue, but my actual problem was related to having D...

Postgres 11 - COMMIT Procedure

Postgres 11 - COMMIT Procedure With the recent update of Postres 11. It now supports stored procedures. Transactions are finally supported in stored procedures in Postgres. However, I have been trying to perform a commit within a procedure with no luck. CREATE OR REPLACE PROCEDURE test_update( IN pid character, IN pcategoryname character varying, IN pwebcode character varying, IN porder numeric, IN pupdatedby character varying, IN pupdateddate timestamp without time zone, IN plang character varying, INOUT cresults refcursor) LANGUAGE plpgsql AS $BODY$ DECLARE cnt bigint; rtnCode char(1); BEGIN cresults := 'cur'; BEGIN update test_table set FCATEGORYNAME = pCategoryName, FWEBCODE = pWebCode, FORDER = pOrder, FUPDATEDBY = pUpdatedBy, FUPDATEDDATE = pUpdatedDate, ...