Re: [GENERAL] skip weekends: revisited

2005-03-14 Thread Andre Maasikas
Jeff Amiel wrote: Back in 2002, Jean-Luc Lachance gave a nifty algorithm (http://archives.postgresql.org/pgsql-sql/2002-06/msg00301.php) for determining the resulting date given a starting date and number of 'workdays' in the future. The trick was that weekends (Saturday and Sunday) could not

Re: [GENERAL] Checking for schedule conflicts

2005-03-14 Thread Andre Maasikas
Ragnar HafstaĆ° wrote: On Sat, 2005-03-12 at 00:13 -0800, Benjamin Smith wrote: Given the tables defined below, what's the easiest way to check for schedule conflicts? So far, the only way I've come up with is to create a huge, multi-dimensional array in PHP, with a data element for every minute

Re: [GENERAL] Count Issues

2004-10-14 Thread Andre Maasikas
Dev wrote: Hello all, I am trying to get a total number of rows returned form a query. SELECT count(this) from table group by this Currently it is returning x rows with a count of each of the group by. I need the count of the rows returned! SELECT COUNT(DISTINCT this) FROM table Andre

Re: [GENERAL] Syntax Issue in Trigger Function??

2004-09-28 Thread Andre Maasikas
[EMAIL PROTECTED] wrote: In Postgres 7.3.5 - When we try to insert a new record into our parties.party table which is then meant to fire off a trigger to update a column in the table with some de-normalised information, we get the following error: ERROR: FLOATING POINT EXCEPTION! The last floatin

Re: [GENERAL] Controlling order of evaluation?

2004-09-28 Thread Andre Maasikas
Jerry LeVan wrote: I have hoped that select * from annual_report(2003) union select * from annual_profit_loss(2003) would print the last select last ;( but it inserts the last selection alphabetically into the rows of the annual_report depending on the label field... I suppose I could use a label "

Re: [GENERAL] guaranteeing that a sequence never skips

2004-10-05 Thread Andre Maasikas
>Sometimes a business requirement is that a serial sequence >never skips, >e.g. when generating invoice/ticket/formal letter numbers. Would an >INSERT INTO t (id, ...) VALUES (SELECT MAX(col)+1 FROM t, ...) >suffice, >or must I install a trigger too to do additional checking? > If id is defin