Search Postgresql Archives

Re: CREATE RULE fails with 'ERROR: SELECT rule's target list has too many entries'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/05/2012 04:07 PM, Tom Lane wrote:
Henrik Kuhn <henrik.kuhn@xxxxxxxxxxx> writes:
can somebody give me some insights why the creation of this rule fails
with 'ERROR:  SELECT rule's target list has too many entries'?
Probably that history_relation has fewer than three columns?  But if
you want something more than guessing, you'd have to provide more
context, such as the definitions of the underlying tables.  Why are
you trying to execute this command anyway?

			regards, tom lane
The history_relatio-DDL is quite simple:

CREATE TABLE history_relation (
    id                  UUID NOT NULL DEFAULT uuid_generate_v4()
, relname name NOT NULL CHECK ( relname::regclass IS NOT NULL ) -- use regclass to validate

  , PRIMARY KEY (id)
);

But are your really sure, that the error is thrown just because of there are not more than 3 cols in history_relation? And then why is the error text '... too many entries' ? It sounds more that the RULE parser can not handle the join over four tables?

The purpose is:
I want to set up an own polymorphic foreign key reference validation system. The key point to this is using uuid as prim. key over all tables to reference to. Because the corresponding prim key names may be different I need to query for its name to build the corresponding join stmt. The TABLE history_relation is for keeping track of the foreign tables.


Regards,
Henrik



--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux