Re: Why?

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Why?
Дата
Msg-id Pine.BSF.4.10.10008271320510.47595-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на Why?  (Juan Carlos Perez Vazquez <cray2@mail.com>)
Список pgsql-hackers
On Sun, 27 Aug 2000, Juan Carlos Perez Vazquez wrote:

> Hi!
> 
> Why does not work this?
> 
> CREATE FUNCTION PWDCHG () RETURNS OPAQUE AS '
> BEGIN
> ALTER USER utest WITH PASSWORD ''ptest'';
> END;
> ' LANGUAGE 'plpgsql';
> 
> select PWDCHG();
> ERROR:  typeidTypeRelid: Invalid type - oid = 0

You don't select functions that have return type
OPAQUE.  Think of functions returning opaque
as procedures that cannot be called in a context
where their return value is used.
Plus, the utility commands aren't fully implemented
in plpgsql in 7.0 (more below)

> and this other?
> 
> CREATE FUNCTION PWDCHG () RETURNS bool AS '
> BEGIN
> ALTER USER utest WITH PASSWORD ''ptest'';
> RETURN ''t'';
> END;
> ' LANGUAGE 'plpgsql';
> 
> select PWDCHG();
> ERROR:  copyObject: don't know how to copy 646

In 7.0 most of the utility commands are not 
available in plpgsql.  They should be available
in 7.1.  I don't know if any of the other pl
languages had utility commands that worked in
7.0 (I don't know tcl and didn't compile pl/perl),
but that's another possibility for how to do it.



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: signed, volatile, etc
Следующее
От: "Mitch Vincent"
Дата:
Сообщение: Re: [SQL] queries and inserts