Re: postgresql vs mysql

From: Tino Wildenhain <tino(at)wildenhain(dot)de>
To: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
Cc: Mark Walker <furface(at)omnicode(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: postgresql vs mysql
Date: 2007-02-23 20:04:06
Message-ID: 45DF48B6.4090609@wildenhain.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Steve Crawford schrieb:
> Mark Walker wrote:
>> I'm not sure what you're trying to do but, it appears that you database
>> design is incorrect. What you need is something like
>>
>> CREATE TABLE temp_readings
>> (
>> _date Date,
>> temperature double,
>> source varchar(20),
>> )
>>
>> No reading, no record. Are you suggesting that you would have a weekly
>> set of records for each row?
>>
>> CREATE TABLE temp_readings
>> (
>> weekstart date,
>> sun double,
>> mon double,
>> tues, double
>> etc
>> )
>>
>> Not such a great way to do it.
>
> Ummm, I'm not trying to make a temperature database. I was responding to
> the previous poster with an extremely simple example of usefulness of
> the _concept_ of "null". I'm afraid I hadn't considered the possibility
> that it would be mistaken as an example of an actual table.
>
> But since you bring it up, simply omitting rows isn't necessarily an
> option. A common scenario for weather observation is to take regular
> snapshots or a bunch of measurements (air-temperature, humidity,
> wind-speed, soil-temperature, leaf-wetness, UV radiation, etc.) which
> can easily be represented in a table with a timestamp and a column for
> each of the measurements. In a modular weather station where a specific
> instrument can be out of service, one or more of those measurements
> could be missing (null) for a period of time while the remaining
> measurements are still being inserted.

Well I indeed have such a weather database, taking about 2 minute
snapshots of a couple of sensors. If one sensor does not respond
or is ignored due to error constraint, I just dont insert
a row: timestamp, sensor_id, sensorvalue, errorvalue

To do something usefull w/ the data you need to interpolate
anyway.

Just an example of how you can indeed avoid null values :-)

Regards
Tino

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Glen Parker 2007-02-23 20:04:31 Re: postgresql vs mysql
Previous Message Alvaro Herrera 2007-02-23 19:51:56 Re: [GENERAL] PostgreSQL on Windows Paper