Re: SQL99 ARRAY support proposal

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: SQL99 ARRAY support proposal
Дата
Msg-id 17166.1047307787@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: SQL99 ARRAY support proposal  (Hannu Krosing <hannu@tm.ee>)
Ответы Re: SQL99 ARRAY support proposal  (Joe Conway <mail@joeconway.com>)
Re: SQL99 ARRAY support proposal  (Joe Conway <mail@joeconway.com>)
Список pgsql-hackers
Hannu Krosing <hannu@tm.ee> writes:
> Joe Conway kirjutas E, 10.03.2003 kell 05:35:
>> CREATE OR REPLACE FUNCTION array_push (anyarray, anyscalar)
>> RETURNS anyarray

> could you make it
> RETURNS typeof($1)

Not directly --- we have to fit the return-type info into an OID field.
We could fake it by inventing one or more pseudotypes, "SAMEASPARAMn".

But I think I like better the notion of extending my bound-together-
ANYARRAY-and-ANYELEMENT proposal,
http://archives.postgresql.org/pgsql-hackers/2003-03/msg00319.php

Suppose that we do that, and then further say that ANYARRAY or
ANYELEMENT appearing as the return type implies that the return type
is actually the common element or array type.  Then we have such
useful behaviors as:
array_push(anyarray, anyelement) returns anyarrayarray_pop(anyarray) returns anyelementarray_subscript(anyarray, int)
yieldsanyelementsingleton_array(anyelement) yields anyarray
 

The last three cases cannot be handled by a SAMEASPARAM construct.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Cursors and backwards scans and SCROLL
Следующее
От: Justin Clift
Дата:
Сообщение: Re: Who puts the Windows binaries on the FTP server?