warning 6002: The table/view no primary key
Posted: 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!
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!