Re: [SQL] Query from multiple tables...

From: Christopher Sawtell <csawtell(at)xtra(dot)co(dot)nz>
To: "Diehl, Jeffrey" <jdiehl(at)sandia(dot)gov>, pgsql-sql(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Cc: "Diehl, Jeffrey" <jdiehl(at)sandia(dot)gov>
Subject: Re: [SQL] Query from multiple tables...
Date: 2001-01-16 22:41:51
Message-ID: 01011711415100.09521@berty
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

On Wed, 17 Jan 2001 09:46, Diehl, Jeffrey wrote:
> Hi all,
>
> I have a database, that because of the size of the data, I have separated
> on day's worth of data into it's own table.

postgreSQL will manage absolutely huge tables without problems.
( 2GB, & 4GB with that file size setting in the kernel )
Why do you have to cut the data into smaller tables?

> I have a separate table for
> each of, say, 30 days. I would like to write a query that will query the
> last 15 days worth of tables. Can this be done?

No problem, if you leave the data in one table.

> I tried to use a view; that didn't work. I tried to use the union clause;
> that didn't allow me to do group by...
>
> Is there a better way than to have my program rewrite the sql on the fly?

you can issue queries direct from the shell script which would allow you to
use shell variables to hold the date datum.

--
Sincerely etc.,

NAME Christopher Sawtell
CELL PHONE 021 257 4451
ICQ UIN 45863470
EMAIL csawtell @ xtra . co . nz
CNOTES ftp://ftp.funet.fi/pub/languages/C/tutorials/sawtell_C.tar.gz

-->> Please refrain from using HTML or WORD attachments in e-mails to me <<--

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2001-01-16 22:57:38 Re: Re: Unknown Type 'ame' [urgent]
Previous Message Karl DeBisschop 2001-01-16 22:36:24 Re: MySQL file system

Browse pgsql-sql by date

  From Date Subject
Next Message Keith Gray 2001-01-17 02:01:14 Boolean and Bit
Previous Message Josh Berkus 2001-01-16 21:18:42 Re: Three questions regarding PL/PGSQL