Invoices

Ludwig Meyerhoff <ludwig@antar.com>

From: Ludwig Meyerhoff <ludwig@antar.com>
To: pgsql-general@postgresql.org
Date: 2001-05-03T20:06:05Z
Lists: pgsql-general
Hallo!

Maybe this is a bit off-topic, as this problem is more a "design"-one, but
I wanted to write a web-application write invoices more easy. I wonder if
it was a good idea to try this using Postgres or if it was better to write
the data of each invoice in a separate file in a separate directory.

I doubt it was a good idea to put all the data into one database like

create table invoices(
  invoice integer primary key,
  datum date,
  customer integer references customers,
  clerk integer references clerks
);
create table invoicedata(
  invoice integer references invoices,
  item integer references services,
);


as this would mean all the information of all invoices is stored in one
table, meaning the table will grow to a HUGE size making queries very
slow.


On the other side I doubt following solution will be a good idea, too!

create table invoices
(
  invoice integer primary key,
  datum date,
  customer integer references customers,
  clerk integer references clerk
);
create table INVOICENUMBER
(
  item integer references services,
  amount integer,
);

as this will create a HUGE number of tables and I think it was not a good
idea to give users permission to create new tables.


Maybe someone can help? 


Saluti!

Ludwig