npgsql

Relation dbo.MyTable not found while schema and table do exist

心已入冬 提交于 2019-12-13 04:50:34
问题 In our MVC 5.2 application on Mono 3.10 I am trying to set up a connection with a PostgreSQL database via Entity Framework 6.1.1. To do this I took the following steps: Included the packages Npsql and Npsql.EntityFramework via NuGet. Added the section <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.1.1, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> to the configSections element in

Is it possible to pass a refcursor as a parameter directly to FETCH on Npgsql?

余生长醉 提交于 2019-12-13 04:26:38
问题 I can't find any way to pass a cursor ref into a FETCH command as a parameter, when using the Npgsql library against PostgreSQL. Is this possible? using (DbConnection connection = new NpgsqlConnection(connectionString)) { connection.Open(); using (DbTransaction transaction = connection.BeginTransaction()) { var outCursor = new NpgsqlParameter("cursor", NpgsqlTypes.NpgsqlDbType.Refcursor); outCursor.Direction = ParameterDirection.Output; // get a refcursor from somewhere using (DbCommand

Npgsql - Specified method is not supported

霸气de小男生 提交于 2019-12-12 23:01:22
问题 This might be somehow connected to this other issue I had with FNH. Fluent NHibernate cannot load MySql.Data from GAC in debug mode of a test Generally I got a simple test that runs following code first: FluentConfiguration config = Fluently .Configure() .Database( PostgreSQLConfiguration.Standard.ConnectionString(c => c.FromConnectionStringWithKey("PostgreSQLConnectionString"))) .Mappings(m => m.FluentMappings.AddFromAssemblyOf<MyMapping>()); s_SessionSource = new SessionSource(config); When

Azure Data factory Copy Pipeline failing if more than 6 columns

一个人想着一个人 提交于 2019-12-12 21:54:04
问题 I'm trying to copy data from a view in either on-premise PostgeSQL or MSSQL to a table in Azure PostgreSQL. I can't seem to get this to successfully copy when I map more than 6 columns from source to sink. I suspected that one of the source columns was the issue, so varied what columns were mapped but all columns will succeed if less than 6 are copied in total. I then tried different source and sink tables, which produces the same results. If I copy to an intermediary csv file I can import

Inserting a duplicate record using Npgsql

谁说胖子不能爱 提交于 2019-12-12 20:13:01
问题 I'm trying to insert data into the following table using the Npgsql ADO.NET provider: CREATE SCHEMA core; CREATE TABLE core.config( name TEXT NOT NULL, value TEXT NOT NULL, CONSTRAINT pk_config PRIMARY KEY (name) ); The first insert works fine but if I try to insert an item with the same name again, Npgsql just hangs. I would expect an exception to be thrown stating that the primary key constraint has been violated, but Npgsql just freezes instead. Sure enough, if I check the server logs I

How to import the npgsql module?

試著忘記壹切 提交于 2019-12-12 16:10:46
问题 I need to connect to a PostgreSQL database from within PowerShell scripts. But how to install npgsql WITHOUT VisualStudio? There is no nuget! So I tried to install the driver in the GAC using the newest MSI file ( Npgsql-3.0.5.msi ). Using gacutil.exe shows, that it is installed: Npgsql, Version=3.0.5.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7, processorArchitecture=MSIL But PowerShell does not know anything about it! Get-Module -ListAvailable should show it but: PS C:\WINDOWS

Postgresql - Create Database & Table dynamically

北慕城南 提交于 2019-12-12 16:01:04
问题 This code is not working. Can anyone direct me where I can find examples of creating a Postgresql database and table on the fly with C#? const string connStr = "Server=localhost;Port=5432; User Id=postgres;Password=enter;Database=postgres"; var m_conn = new NpgsqlConnection(connStr); // creating a database in Postgresql m_createdb_cmd = new NpgsqlCommand("CREATE DATABASE IF NOT EXISTS \"testDb\" " + "WITH OWNER = \"postgres\" " + "ENCODING = 'UTF8' " + "CONNECTION LIMIT = -1;", m_conn); //

Installing ngpsql to use PostgreSQL in PowerBI

回眸只為那壹抹淺笑 提交于 2019-12-12 10:40:04
问题 I'm trying to get data from a PostgreSQL database into PowerBI Desktop but it doesn't seem to work. I think the problem is with the installation with npgsql. When trying to setup a new database connection in PowerBI I type in the database and server, and this is the error message I get: "Unable to connect Details: "PostgreSQL: We were unable to find a database provider with invariant name 'Npgsql'. This error could've been the result of provider-specific client software being required, but

npgsql data type unknown when using group by

你离开我真会死。 提交于 2019-12-12 10:25:10
问题 I have 2 tables: CREATE TABLE "book" ( "id" serial PRIMARY KEY, "ean_number" TEXT NULL, "title" TEXT NULL ); CREATE TABLE "e_book" ( "id" serial PRIMARY KEY, "ean" TEXT NULL, "title" TEXT NULL, "format" VARCHAR(255) NOT NULL, "physical_book_ean" TEXT NULL ); There is a one to many or none relationship from book to e_book. I want to run a query like this in my code: var q = "select b.*, array_agg(e) ebooks from book b " + "left join e_book e on e.physical_book_ean = b.ean_number " + "group by

NpgsqlConnection hangs for hours on opening connection

感情迁移 提交于 2019-12-12 10:18:47
问题 I was able to successfully connect using Npgsql nuget package, until one day the program started hanging for hours on executing conn.Open() without returning. I can successfully connect with Aginity client with same parameters. I tried Firewall On and Off. I tried Antivirus On and Off. I tried Fiddler On and Off. Some things to Note: I need to be on VPN to connect to that host. It just hangs for hours, when conn.Open() is executed. When I am not on VPN, it times out immediately. We can't see