Wrong Schema Problem

Wrong Schema Problem

Postby ucelenli » Thu 23 Jan 2014 14:38

I am using Devart DotConnect for Postgresql. Devart.Data.Postgresql version is
I have different schemas on a single database and I'm trying to connect to a schema called, say "test1".

My connectionstring (which I pass to the constructor of Entitites object) is as follows:

Code: Select all
res://Entity.DataModel.msl;provider=Devart.Data.PostgreSql;provider connection
string="Server=localhost; Port=5432;User Id=xxxxxx;Database=xxxxxx;Unicode=true;
Initial Schema=test1;"

when I create the new Entities object with this connection string, I try to call db.CreateDatabase() I expect the tables to be generated on schema "test1" but it tries to create them on "public". I get an error like this;

"relation Notification already exists" CREATE TABLE public."Notification" (
"Id" bigserial NOT NULL,

I used Initial Schema="test1" in the connection string but the entity object uses public schema.

Why is this happening?
Posts: 5
Joined: Thu 09 Jun 2011 16:19

Re: Wrong Schema Problem

Postby Shalex » Fri 24 Jan 2014 13:57

Seems like your Notification table has the "Schema=public" attribute in SSDL (Store) part of the model. You should clear the Schema value in design-time with Entity Developer (or with XML Editor in case of EDM Designer).
Devart Team
Posts: 7654
Joined: Thu 14 Aug 2008 12:44

Return to dotConnect for PostgreSQL