Re: nOOB Question..

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: herbie(at)faams(dot)net, pgsql-novice(at)postgresql(dot)org
Subject: Re: nOOB Question..
Date: 2003-05-31 01:00:36
Message-ID: 200305301800.36037.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2003-05-31 02:29:13 Re: why doesn't an index help my simple query?
Previous Message Peter Bierman 2003-05-30 23:54:34 why doesn't an index help my simple query?