When I set my search path to 'usr, public' then PgSqlCommand for CommandType.StoredProcedure only searches the usr schema and does not find any functions in the public schema.
Has this bug been fixed? I am using 7.3.333.0.
PgSqlCommand only uses first entry in search path
-
- Posts: 1
- Joined: Fri 27 Nov 2015 09:56
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: PgSqlCommand only uses first entry in search path
We could not reproduce the issue. In our environment it works both with 7.3.333 and with the latest version of dotConnect for PostgreSQL. We have created a simple example. This example connects to the test1 schema. Then we set search_path for schemas test and public. The test1 function exists only in the schema public.
The DDL script of the test1 function:
C# code:
Please tell us what changes we need to make to this example in order to reproduce the issue.
The DDL script of the test1 function:
Code: Select all
CREATE OR REPLACE FUNCTION test1()
RETURNS integer AS
$BODY$
begin
return 10;
end;$BODY$
LANGUAGE plpgsql VOLATILE
COST 100;
ALTER FUNCTION test1() OWNER TO postgres;
Code: Select all
PgSqlConnection conn = new PgSqlConnection("Host=<HOST>;port=5434;User Id=postgres;pwd=<PASSWORD>;schema=test1;");
conn.Open();
PgSqlCommand comm = new PgSqlCommand("SET search_path TO test, public", conn);
comm.ExecuteNonQuery();
comm = new PgSqlCommand("test1", conn);
comm.CommandType = System.Data.CommandType.StoredProcedure;
comm.Parameters.Add("return_value", PgSqlType.Int).Direction = System.Data.ParameterDirection.ReturnValue;
comm.ExecuteNonQuery();
Console.WriteLine(comm.Parameters[0].Value);
conn.Close();