Re: BUG #4533: Plpgsql complex type failure

Поиск
Список
Период
Сортировка
От Rod Taylor
Тема Re: BUG #4533: Plpgsql complex type failure
Дата
Msg-id 751261b20811221052o4a0f07e3pfe6b944fba385ef9@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #4533: Plpgsql complex type failure  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
That was the short form exhibiting the bug. Selecting the complex
column from a table into a value results in the same error.


BEGIN;

CREATE TYPE timestamp_with_precision AS
( timestamp timestamp with time zone
, timestamp_precision varchar
);

CREATE TABLE timetest(t timestamp_with_precision);
INSERT INTO timetest VALUES ((CURRENT_DATE, 'day')::timestamp_with_precision);

CREATE OR REPLACE FUNCTION testfunc() RETURNS boolean AS $FUNC$
DECLARE
 v_time timestamp_with_precision;
BEGIN
 SELECT t
   INTO v_time
   FROM timetest;

 RETURN true;
END;
$FUNC$ LANGUAGE plpgsql VOLATILE SECURITY DEFINER RETURNS NULL ON NULL
INPUT;

SELECT testfunc();

ROLLBACK;





On Sat, Nov 22, 2008 at 1:37 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> "Rod Taylor" <rod.taylor@gmail.com> writes:
>> DECLARE
>>   v_time timestamp_with_precision;
>> BEGIN
>>   SELECT (CURRENT_DATE, 'day')::timestamp_with_precision
>>     INTO v_time;
>
> You're overthinking the problem, it should just read
>
>  SELECT CURRENT_DATE, 'day'
>    INTO v_time;
>
>                        regards, tom lane
>

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

Предыдущее
От: Ferdinand Gassauer
Дата:
Сообщение: Re: BUG #4547: sort columns in \d
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pg_dumpall restore fails