Обсуждение: BUG #1481: ERROR: type tablename does not exist

Поиск
Список
Период
Сортировка

BUG #1481: ERROR: type tablename does not exist

От
"alagu madhu"
Дата:
The following bug has been logged online:

Bug reference:      1481
Logged by:          alagu madhu
Email address:      almadhu@yahoo.com
PostgreSQL version: 8.0
Operating system:   Redhat
Description:        ERROR:  type tablename does not exist
Details:

CREATE FUNCTION merge_fields(t_row tablename) RETURNS text AS $$
DECLARE
    t2_row table2name%ROWTYPE;
BEGIN
    SELECT * INTO t2_row FROM table2name WHERE ... ;
    RETURN t_row.f1 || t2_row.f3 || t_row.f5 || t2_row.f7;
END;
$$ LANGUAGE plpgsql;

Re: BUG #1481: ERROR: type tablename does not exist

От
Michael Fuhr
Дата:
On Mon, Feb 14, 2005 at 10:21:08AM +0000, alagu madhu wrote:
>
> Description:        ERROR:  type tablename does not exist
> Details:
>
> CREATE FUNCTION merge_fields(t_row tablename) RETURNS text AS $$

Do you have a table or composite type named "tablename"?  Your
example works for me in 8.0.1 if tablename and table2name both
exist.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/