Re: array_append from user-defined C function - Mailing list pgsql-general

From Pavel Stehule
Subject Re: array_append from user-defined C function
Date
Msg-id CAFj8pRD3Bpg-_a5yW5Ev4nLM7a007hBC0zGN0EepzTuP6be7GQ@mail.gmail.com
Whole thread Raw
In response to Re: array_append from user-defined C function  (Leonardo Francalanci <m_lists@yahoo.it>)
List pgsql-general
2011/10/14 Leonardo Francalanci <m_lists@yahoo.it>:
>
>
>> how can I call array_append from a user-defined C function?
>> I know the type of the array I'm going to use (int4[]) so if there's an
>> equivalent
>>
>> function that can be called without going through PG_FUNCTION_ARGS stuff...
>
>
> I just found "array_set" (the array I'm using is one-dimensional).
> I'll try to use that... sorry for the noise.

look for array_push function

postgres=# \df+ array_append
List of functions
─[ RECORD 1 ]───────┬─────────────────────────────────
Schema              │ pg_catalog
Name                │ array_append
Result data type    │ anyarray
Argument data types │ anyarray, anyelement
Type                │ normal
Volatility          │ immutable
Owner               │ postgres
Language            │ internal
Source code         │ array_push
Description         │ append element onto end of array
you c

but this is a polymorphic function, so is not simply to call it.

Regards

Pavel Stehule
>
>
> Leonardo
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

pgsql-general by date:

Previous
From: Leonardo Francalanci
Date:
Subject: Re: array_append from user-defined C function
Next
From: Willy-Bas Loos
Date:
Subject: Re: [HACKERS] register creation date of table