Stephen Russell wrote: > On Tue, Feb 23, 2010 at 4:51 PM, Leland F. Jackson, CPA > <[email protected]> wrote: > ----------------- > Does anyone take advantage of the features of the database, or is it > just for storage? > > Would any of you use an array as a storage type? > > CREATE TABLE sal_emp ( > name text, > pay_by_quarter integer[], > schedule text[][] > ); > > That is cool as shit. > > > Now we can show some INSERT statements: > > INSERT INTO sal_emp > VALUES ('Bill', > '{10000, 10000, 10000, 10000}', > '{{"meeting", "lunch"}, {"training", "presentation"}}'); > > INSERT INTO sal_emp > VALUES ('Carol', > '{20000, 25000, 25000, 25000}', > '{{"breakfast", "consulting"}, {"meeting", "lunch"}}'); > The result of the previous two inserts looks like this: > > SELECT * FROM sal_emp; > name | pay_by_quarter | schedule > -------+---------------------------+------------------------------------------- > Bill | {10000,10000,10000,10000} | {{meeting,lunch},{training,presentation}} > Carol | {20000,25000,25000,25000} | {{breakfast,consulting},{meeting,lunch}} > (2 rows) > > > PostgreSQL is real powerful in capability. > >
Maybe, but then your database is not normalized. It is not in 1NF, or you might say it's in N1NF. Now does the query language provide an "unnest" operator? How does it work? Is it more complicated than if I had my tables normalized? What have I gained by de-normalizing my database? _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[email protected] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

