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

Поиск
Список
Период
Сортировка
От Henrik Kuhn
Тема CREATE RULE fails with 'ERROR: SELECT rule's target list has too many entries'
Дата
Msg-id 50BF4626.2030102@origenis.de
обсуждение исходный текст
Ответы Re: CREATE RULE fails with 'ERROR: SELECT rule's target list has too many entries'
Список pgsql-general
Hi,

can somebody give me some insights why the creation of this rule fails
with 'ERROR:  SELECT rule's target list has too many entries'?

CREATE RULE "_RETURN" AS
   ON SELECT TO history_relation
   DO INSTEAD
     SELECT
       history_relation.id,
       history_relation.relname,
       pg_attribute.attname AS keyname
     FROM
       history_relation, pg_index, pg_class, pg_attribute
     WHERE
       pg_class.oid = history_relation.relname::regclass AND
       indrelid = pg_class.oid AND
       pg_attribute.attrelid = pg_class.oid AND
       pg_attribute.attnum = any(pg_index.indkey)
       AND indisprimary;

The purpose of this rule is to retrieve the primary key name upon the
given table name (relname) stored in the table 'history_relation' upon
SELECT only.

Kind regards,
Henrik




В списке pgsql-general по дате отправления:

Предыдущее
От: "Gauthier, Dave"
Дата:
Сообщение: Re: how do I grant select to one user for all tables in a DB?
Следующее
От: Edson Richter
Дата:
Сообщение: Re: Table with million rows - and PostgreSQL 9.1 is not using the index