Arrays

From: Bob Pawley <rjpawley(at)shaw(dot)ca>
To: Postgresql <pgsql-general(at)postgresql(dot)org>
Subject: Arrays
Date: 2006-01-26 18:15:22
Message-ID: 00c301c622a4$78df7850$ac1d4318@owner
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I would like to make a table of 20 plus columns the majority of columns being arrays.

The following test works. The array will hold up to five characteristics of each parameter including the unit of measurement used. Using traditional methods I would need six columns to accomplish the same end (Min, Max, Norm plus a unit column for each).

The downside is that the number of brackets required increases for each succeeding column for insert and update. The last column would comprise 48 brackets, 24 before - 24 after.

Is there a work-around for this.

Bob Pawley

create table specifications (
fluid_id int4 ,
Flow_Rate varchar array[5],
Temperature varchar array[5],
Pressure_In varchar array[5] ,
Pressure_Out varchar array[5]
);

insert into specifications values ('1', '{25, 50, 100, gpm}', '{{100, 250, 500, DegF}}',
'{{{10, 40, 100, psi}}}', '{{{{60, 120, 150, psi}}}}' );

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Seneca Cunningham 2006-01-26 18:15:46 Re: Encoding errors when upgrading from 7.4 to 8.1
Previous Message Michael Fuhr 2006-01-26 18:12:21 Re: Suggestions on storing and retrieving geocode data