Re: The tuple structure of a not-yet-assigned record is indeterminate.

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: The tuple structure of a not-yet-assigned record is indeterminate.
Дата
Msg-id 49C74B0A.8010404@postnewspapers.com.au
обсуждение исходный текст
Ответ на Re: The tuple structure of a not-yet-assigned record is indeterminate.  (M L <novemberox@gmail.com>)
Ответы Re: The tuple structure of a not-yet-assigned record is indeterminate.  (M L <novemberox@gmail.com>)
Список pgsql-general
M L wrote:

>   CREATE VIEW tabelka AS SELECT someint FROM t_matches;

What exactly are you trying to do here? If it worked how you've written
it,  you'd get the value of `someint' repeated once for each row that
appears in t_matches.

I don't know exactly why you're seeing the behaviour you are. However,
the it works if you build the statement you want as a string and invoke
it using EXECUTE:

CREATE OR REPLACE FUNCTION add_view() RETURNS trigger AS $$
DECLARE
  someint integer;
BEGIN
  EXECUTE 'CREATE VIEW tabelka AS SELECT '||NEW.id||' FROM t_matches;';
RETURN NULL;
END;
$$ language plpgsql;

... though the view produced isn't very useful.

--
Craig Ringer

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

Предыдущее
От: Ivan Sergio Borgonovo
Дата:
Сообщение: Re: text column constraint, newbie question
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: text column constraint, newbie question