From: | "Eric G(dot) Miller" <egm2(at)jps(dot)net> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Query |
Date: | 2001-04-08 07:17:39 |
Message-ID: | 20010408001739.D13742@calico.local |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(at)jps(dot)net>
From | Date | Subject | |
---|---|---|---|
Next Message | Oliver Elphick | 2001-04-08 07:17:42 | Re: Inheritance and referential integritry in 7.0.3 |
Previous Message | Oliver Elphick | 2001-04-08 07:15:05 | Re: inheritance and foreign keys |