cannot have 0 columns

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
dcb
Posts: 5
Joined: Tue 13 Oct 2009 23:19

cannot have 0 columns

Post by dcb » Tue 20 Oct 2009 21:23

I'm getting the error in the title when using the DataSet Wizard.
I suspect this happens because the table it stops at contains an expression index.

So, are expression indexes supported? Can they at least be ignored so I can still generate the dataset without the index?

Here is the table definition:

Code: Select all

CREATE TABLE sf_guard_user
(
  id integer NOT NULL,
  username character varying(128) NOT NULL,
  algorithm character varying(128) NOT NULL DEFAULT 'sha1'::character varying,
  salt character varying(128) NOT NULL,
  "password" character varying(128) NOT NULL,
  created_at timestamp without time zone,
  last_login timestamp without time zone,
  is_active boolean NOT NULL DEFAULT true,
  is_super_admin boolean NOT NULL DEFAULT false,
  CONSTRAINT sf_guard_user_pkey PRIMARY KEY (id)
)
WITH (
  OIDS=FALSE
);

CREATE UNIQUE INDEX sf_guard_user_lower_username
  ON sf_guard_user
  USING btree
  (lower(username::text));

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Thu 22 Oct 2009 08:46

Please try creating the index without using the lower() function. DataSet Wizard should work without error in this case:

Code: Select all

DROP INDEX sf_guard_user_lower_username;
CREATE UNIQUE INDEX sf_guard_user_lower_username  ON sf_guard_user  USING btree  (username);
We will investigate the reason of such behaviour and notify you about the results as soon as possible.

dcb
Posts: 5
Joined: Tue 13 Oct 2009 23:19

Post by dcb » Fri 23 Oct 2009 16:26

Yes, I know it works without the expression index, but I do have expression indexes on many tables and they are important to the application, I can't simply remove them.

This is a new project so I had the luxury to change to LINQ, so this is not an issue for me anymore.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Mon 26 Oct 2009 16:59

We suggested not to remove the indexes but recreate them without using lower function.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Thu 29 Oct 2009 13:24

The columns for index should be set explicitly without using any functions.

dcb
Posts: 5
Joined: Tue 13 Oct 2009 23:19

Post by dcb » Sun 01 Nov 2009 03:05

I understood what you meant. What I'm trying to say is that expression indexes are really important to my application. I just can't replace them with simple column indexes. That was just one simple example, but I have other more complex expression indexes.

My proposal was to simply ignore them for now in the wizard instead of aborting the generation of the dataset. It is better to have a dataset without those indexes than not having a dataset at all :)

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Wed 04 Nov 2009 08:22

We have changed our DataSet generation: if index is set as an expression, this index will be ignored. This behaviour will be available starting from the next build.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Fri 20 Nov 2009 16:31

dotConnect for PostgreSQL v 4.65 is released.
It can be downloaded from http://www.devart.com/dotconnect/postgr ... nload.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://www.devart.com/forums/viewtopic.php?t=16438.

Post Reply