Re: [SQL] Need to Iterate the record in plpgsql

2012-09-04 Thread Sergey Konoplev
If you do not need information about column types you can use hstore for this purpose. [local]:5432 grayhemp@grayhemp=# select * from r limit 1; a | b | c ---+---+--- 1 | 2 | 3 (1 row) [local]:5432 grayhemp@grayhemp=# select * from each((select hstore(r) from r limit 1)); key | value -+---

[SQL] Question regarding modelling for time series

2012-09-04 Thread Alex Grund
Hi there, I want to use a database for storing economic time series. An economic time series can be thought of as something like this: NAME| RELEASE_DATE | REPORTING_DATE | VALUE +--++--- Unemployment US | 2011/01/01 | 2010/12/01

Re: [SQL] Question regarding modelling for time series

2012-09-04 Thread Sergey Konoplev
On Wed, Sep 5, 2012 at 12:16 AM, Alex Grund wrote: > So, I thought of a relational data base model like that: It is worth to make like this TABLE 'ts' (TimeSeries) PK:id | name TABLE 'r' (Releases) PK:id | FK:ts_id | release_date | reporting_date | value It is a little more redundant but easie