Re: Query

Поиск
Список
Период
Сортировка
От Eric G. Miller
Тема Re: Query
Дата
Msg-id 20010408001739.D13742@calico.local
обсуждение исходный текст
Ответ на Query  ("Atul" <atulk@newgen.co.in>)
Список pgsql-general
On Fri, Apr 06, 2001 at 06:57:03PM +0530, Atul wrote:
> Hi,
>
> I have a query regarding composite types (user-defined types). I have
> defined a type alongwith its input and output functions. But I am not
> able to access the type using my PL/pgSQL function. My type is as
> follows
>
> typedef struct Sample { int nCtr1, int nCtr2 } Sam;
>
> If anyone has some clue about it please mail back.

PL/PgSQL is not going to be able to look into your structure if that's
what you want.  PostgreSQL treats such things as blobs of memory.  You
might define accessor functions though...

int4
SampleGetnCtr1 (Sam *s)
{
    return s->nCtr1;
}

Etc...

Then, maybe, you can call the function(s) to get/set it's parts...

SELECT sample_get_ctr1(mysample) INTO foo FROM ... ;

--
Eric G. Miller <egm2@jps.net>

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

Предыдущее
От: Mario Weilguni
Дата:
Сообщение: strange query plan
Следующее
От: "Eric G. Miller"
Дата:
Сообщение: Re: Inheritance and referential integritry in 7.0.3