That's why you make a table for every device or every measurement, and
then use a view to consolidate it.  With updatable views, there's no
excuse not to.

--
Brandon Aiken
CS/IT Systems Engineer

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Steve Crawford
Sent: Friday, February 23, 2007 1:04 PM
To: Mark Walker
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] postgresql vs mysql

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.

Cheers,
Steve


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org/


--------------------------------------------------------------------
** LEGAL DISCLAIMER **
Statements made in this e-mail may or may not reflect the views and 
opinions of Wineman Technology, Inc. or its employees.

This e-mail message and any attachments may contain legally privileged, 
confidential or proprietary information. If you are not the intended 
recipient(s), or the employee or agent responsible for delivery of 
this message to the intended recipient(s), you are hereby notified 
that any dissemination, distribution or copying of this e-mail 
message is strictly prohibited. If you have received this message in 
error, please immediately notify the sender and delete this e-mail 
message from your computer.

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to [EMAIL PROTECTED] so that your
       message can get through to the mailing list cleanly

Reply via email to