1

How do one create an array of a user defined type in PostgreSQL 8.1 (Greenplum)?

I have the type:

create type tp_keyval as (
  key_nm   text
 ,key_vals text[]
);

I would like an array something like:

v_keyval_set tp_keyval[];

According to the documentation it can be done and should work .. I even tried it with the underscore as indicated in the documentation, but to no avail.

v_keyval_set _tp_keyval;

Could someone please provide an example of how to do this.

Regards, Johan

pozs
  • 34,608
  • 5
  • 57
  • 63
  • If your type is `tp_keyval` then `tp_keyval[]` and `tp_keyval ARRAY` (SQL compatible) should work (`_tp_keyval` is only for internal usage - implementation detail - do not use it explicitly). *but to no avail* - What is your error message? Can you provide some more context (f.ex. the whole stored procedure)? – pozs Jan 27 '15 at 14:12
  • Hi all,Unfortunately i have moved on from the client and no longer have access to the Greenplum (PostgrfeSQL) database. – Johan Swart Feb 11 '15 at 04:23
  • BTW: tp_keyval [] did not work, I tried that first. – Johan Swart Feb 11 '15 at 04:24

0 Answers0