Re: Tricky SQL problem - retrieve information_schema info and make use of it. - Mailing list pgsql-novice

From Paul Linehan
Subject Re: Tricky SQL problem - retrieve information_schema info and make use of it.
Date
Msg-id CAF4RT5TNOgkrRoqzOx_G424edS607YsX=GSSyqtzdGEohnVNow@mail.gmail.com
Whole thread Raw
In response to Re: Tricky SQL problem - retrieve information_schema info and make use of it.  (Steve Crawford <scrawford@pinpointresearch.com>)
Responses Re: Tricky SQL problem - retrieve information_schema info and make use of it.
List pgsql-novice
Hi, and thanks for your input.

>> I want to be able to query results for each salesman - but new sales
>> personnel are being added and deleted all the time, so a static list
>> is not appropriate.


> OK, we won't blame you.

Phew! :-)


> But since the tables are identical, have you
> considered inheritance?


Ah, therein lies the rub! This system has to work on MS SQL Server
and Oracle - I'll look into this solution there also.


> Create table allsalespersons... to have a master table with the same
> structure as the individual salesperson.

> For existing tables, convert them to child tables:
> alter table fred inherit allsalespersons;
> ...
> For new tables just create them as inherited to begin with.
> Now you can select from "allsalespersons" and get everyone.


It's certainly an elegant solution - I'll just have to see what can be done on
other RDBMSs - thanks again for your input.


Paul...


> Steve


pgsql-novice by date:

Previous
From: Paul Linehan
Date:
Subject: Re: Tricky SQL problem - retrieve information_schema info and make use of it.
Next
From: Wei Shan
Date:
Subject: Re: Help with text(decimal) to hex conversion