Re: [SQL] Many to many link tables with history?

2013-10-10 Thread Craig R. Skinner
On 2013-10-10 Thu 15:25 PM |, Dylan Sanders wrote: > > unregister-pattern ? -- Craig Skinner | http://twitter.com/Craig_Skinner | http://linkd.in/yGqkv7 -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsq

Re: [SQL] Many to many link tables with history?

2013-10-10 Thread Dylan Sanders
unregister-pattern soe...@gmail.com On Thu, Oct 10, 2013 at 3:23 PM, Craig R. Skinner wrote: > On 2013-10-08 Tue 18:04 PM |, Craig R. Skinner wrote: > > Hi folks, I'm new here. I hope this is the correct list > > > > While creating a database of customer subscribed services with > > DNS do

Re: [SQL] Many to many link tables with history?

2013-10-10 Thread Craig R. Skinner
On 2013-10-08 Tue 18:04 PM |, Craig R. Skinner wrote: > Hi folks, I'm new here. I hope this is the correct list > > While creating a database of customer subscribed services with > DNS domains, I want to: > *) enable customers to subscribe to multiple services > *) each service can have multip

Re: [SQL] generate a range within a view

2013-10-10 Thread Gary Stainburn
I've managed to do it using a function, shown below, but is there a better way? create type site_user_department_limits as (s_id char, de_id int4, date date, day_id_week int4, day_limit); create or replace function site_user_department_limits(date,date) returns setof site_user_department_l

[SQL] generate a range within a view

2013-10-10 Thread Gary Stainburn
I have two tables, one defining a standard week by user department, the other defining a calendar where specific dates can deviate from the standard. The tables are shown below. I'm trying to generate a view where I can do select * from user_department_daily_limits where de_date >= '2013-10-06'