Re: nOOB Question.. - Mailing list pgsql-novice

From Josh Berkus
Subject Re: nOOB Question..
Date
Msg-id 200305301800.36037.josh@agliodbs.com
Whole thread Raw
In response to nOOB Question..  (Herbie <herbie@faams.net>)
Responses Re: nOOB Question..
List pgsql-novice
Herbie,

> I've been using PosgreSQL for less than one week. Got it installed and it
> appears to be running.

Congratulations.

> Before really screwing things up, I like to at least read the docs at least
> once.

<grin>
BTW, there are also several good PostgreSQL books on the market which are more
accessable than the online docs.

> Being a business/accounting type developer, I noticed that we have access
> to array type columns.
>
> In the example I found:
>
>   CREATE TABLE foo (
>       barr                 text,
>       doo_daa       numeric(7,2)[]
>
> );
>
> Is this the correct syntax for create a the row doo_daa as a numeric array?

I believe so, yes.

> If this is correct, what is the limit on the number of the extents of the
> array?

There isn't one.  You can provide one (NUMERIC(7,2)[5]) but it will not be
enforced.   Joe Conway is overhauling array handling for 7.4; I don't know if
array limits will be enforcable in the future.

FWIW, I primarily develop business/accounting applications, and have to say
that arrays as a data type have no place in business/financial applications
in permanent tables.  I have yet to see a case in such an application where a
child table was not more appropriate than an array.  Arrays are very useful
for functions, caching, and temporary tables for "flattened" relational data,
but should be avoided for real data tables.

(Please note that this does not apply to scientific, mathematical, or
geographic databases, which have *lots* of reasons to use arrays)


--
Josh Berkus
Aglio Database Solutions
San Francisco

pgsql-novice by date:

Previous
From: Peter Bierman
Date:
Subject: why doesn't an index help my simple query?
Next
From: Tom Lane
Date:
Subject: Re: why doesn't an index help my simple query?