Hi everyone,
i’m desperately trying to connect to my CrateDB with .NET using npgsql.
Here is my code:
var connString = "Host=127.0.0.1;Username=crate;Password=";
using (var conn = new NpgsqlConnection(connString))
{
conn.Open();
}
When i run this piece of code i get the Npgsql.PostgresException {“XX000: RelationUnknown: Relation ‘pg_proc’ unknown”}
As i understand npgsql is trying to read some meta data (e.g. data type) from a table named pg_proc, but in my CrateDB installation this relation does not exist.
Right now i only have a table called my_table and tweets from the twitter sample using the website.
Can anyone help me, please?
Regards
Dominic
Are you using the stock npgsql driver or our npgsql fork ?
i’m not sure what you mean by stock npgsql. I installed npgsql 4.0.7 using the NuGet package manager in VS2015.
I thought it will be the same result as described in your link.
EDIT: npgsql 4.0.7 was of course not the correct package. My bad…
Now i downloaded npgsql.CrateDB 1.2.3 and i get another error at the exact same method Open():
XX000: SQLParseException: line 2:51: mismatched input ‘READ’ expecting {, ‘,’, ‘;’}
SQL Statement:
BEGIN TRANSACTION ISOLATION LEVEL REPEATABLE READ READ ONLY
Which version of CrateDB are you using?
I suspect that the client is invoking BEGIN TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
or some similar statement, which is supported in CrateDB 3.1.0 or later.
I was able to fix it by re-installing the CrateDB, but i still don’t now what went wrong.
Thank you for your input @mfussenegger