warning 6002: The table/view no primary key

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
tzi
Posts: 5
Joined: Tue 15 Jun 2010 19:30

warning 6002: The table/view no primary key

Post by tzi » Tue 15 Jun 2010 19:48

Dear Community,

edit: Using Vs2008 SP1, latest dotConnect for Postgresql, latest Postgresql DB (8.4.4) running on Win7

I have got serious issues with dotconnect for Postgresql. I tried a simple example, generating an EF Model from a database with a single table:

CREATE TABLE manufacturers
(
manufacturerid smallint NOT NULL,
manufacturername character varying(125) NOT NULL,
CONSTRAINT manufacturers_pkey PRIMARY KEY (manufacturerid)
)
WITH (
OIDS=FALSE
);


The resulting code in the model (model1.edmx) is:


SELECT
manufacturers.manufacturerid AS manufacturerid,
manufacturers.manufacturername AS manufacturername
FROM public.manufacturers AS manufacturers


Further I find the following error:
warning 6002: The table/view 'mydb.public.manufacturers' does not have a primary key defined. The key has been inferred and the definition was created as a read-only table/view.


Seems that the EF generator is unable to find my primary key and therefore generates a view rather then a table. Any inserts or updates using the EF objects subsequently failes.

Any ideas whats wrong?
Thanks!

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Wed 16 Jun 2010 10:59

The problem seems to be associated with the server version. We are investigating it.
Is the problem reproducible using Entity Developer (try to add Devart Entity model to your project)?

tzi
Posts: 5
Joined: Tue 15 Jun 2010 19:30

Post by tzi » Wed 16 Jun 2010 11:30

Hi!

Thank you for your answer, I will try to reproduce the issue with your Entity Designer instead of the VS2008 one.

However, which PostgreSQL server Version do you recommend to use?

Thanks, Tom

tzi
Posts: 5
Joined: Tue 15 Jun 2010 19:30

Post by tzi » Wed 16 Jun 2010 16:41

Hi!

The Devart ED did his job quite nice, some FKs werent recognized correctly (due to some datatype issues on the DB).

But, whats the issue with VS2008 ED?

Yours, Tom

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Tue 22 Jun 2010 10:12

I have requested some information with the help of e-mail that you have provided in your forum profile.

Post Reply