Re: [SQL] Event recurrence - in database or in application code ????

2002-08-20 Thread Mark Stosberg
Hello Darrin, I recently implemented what I would consider the "hard part" of a solution to this using Perl and Postgres. My solution handles multi-day events and recurring events, including events that are both multi-day and recurring. Here's an overview of how I did it: A table called "calend

Re: [SQL] functions and triggers

2002-08-20 Thread Stephan Szabo
On Tue, 20 Aug 2002, Martin Marques wrote: > Quoting Stephan Szabo <[EMAIL PROTECTED]>: > > > > > > The problemas are two: > > > > > > 1) when I try to create the trigger, it says that the function doesn't > > exist. > > > Why is this happening? > > > > You should probably show us what you were t

Re: [SQL] functions and triggers

2002-08-20 Thread Martin Marques
Quoting Stephan Szabo <[EMAIL PROTECTED]>: > > > The problemas are two: > > > > 1) when I try to create the trigger, it says that the function doesn't > exist. > > Why is this happening? > > You should probably show us what you were trying to do, but I'm going to > guess that the function doesn

Re: [SQL] functions and triggers

2002-08-20 Thread Stephan Szabo
On Tue, 20 Aug 2002, Martin Marques wrote: > I'm trying to build a trigger that will update a timestamp field in a table with > the current timestamp, and I just can't make it work. > > The problemas are two: > > 1) when I try to create the trigger, it says that the function doesn't exist. > Why

[SQL] functions and triggers

2002-08-20 Thread Martin Marques
I'm trying to build a trigger that will update a timestamp field in a table with the current timestamp, and I just can't make it work. The problemas are two: 1) when I try to create the trigger, it says that the function doesn't exist. Why is this happening? 2) How does the trigger tell the func

Re: [SQL] Problem with timestamp field/time function.. (upgrading

2002-08-20 Thread Stephan Szabo
On Tue, 20 Aug 2002, Lucas Brasilino wrote: > I'm running postgresql 7.0 with a column like: > > Table "materia" > Column | Type | Modifiers > +--+--- > > materiadata| timesta

[SQL] Problem with timestamp field/time function.. (upgrading from 7.0 to 7.2.1)

2002-08-20 Thread Lucas Brasilino
Hi All: I've googling around, searching the mailinglist archive and reading FAQ's but I haven't find the answer for my question. And I know it is quite commom! I'm trying upgrading to 7.2.1. I'm running postgresql 7.0 with a column like: Table "materia"

Re: [SQL] sql subqueries problem

2002-08-20 Thread Mathieu Arnold
>> I've tried, but, as the subselect is an aggregate, I can't get it (maybe >> I don't know enough about it to do it :) > > Right, that'd make it harder. :) > > Hmm, would something like: > > FROM > (select *, > (select sum(ff.montant_ttc/df.taux) from facture ff join > devise as df using

Re: [SQL] bulk imports with sequence

2002-08-20 Thread Tom Lane
"Aaron Held" <[EMAIL PROTECTED]> writes: > I am importing a large number of records monthly using the \copy (from text >file)command. > I would like to use a sequence as a unique row ID for display in my app. > Is there any way to let postgresql generate the sequence itself. Currently the only

Re: [SQL] sql subqueries problem

2002-08-20 Thread Stephan Szabo
On Tue, 20 Aug 2002, Mathieu Arnold wrote: > --On lundi 19 août 2002 09:45 -0700 Stephan Szabo > <[EMAIL PROTECTED]> wrote: > > > > > On Mon, 19 Aug 2002, Mathieu Arnold wrote: > > > >> Hi > >> > >> I have my accounting in a database, and I have a problem with subqueries, > >> here is what I have

[SQL] Event recurrence - in database or in application code ????

2002-08-20 Thread Darrin Domoney
One of the features that I am attempting to implement in the system that I am building is the capability to schedule events (with recurrence). My question to those of you that are more experienced in postgresql is whether you would implement this functionality in the database level using triggers

Re: [SQL] bulk imports with sequence

2002-08-20 Thread Dan Langille
On 20 Aug 2002 at 7:55, Aaron Held wrote: > I am importing a large number of records monthly using the \copy (from > text file)command. > > I would like to use a sequence as a unique row ID for display in my > app. > > Is there any way to let postgresql generate the sequence itself. > Currentl

[SQL] bulk imports with sequence

2002-08-20 Thread Aaron Held
I am importing a large number of records monthly using the \copy (from text file)command. I would like to use a sequence as a unique row ID for display in my app. Is there any way to let postgresql generate the sequence itself. Currently the only way I can make it work is to grab the next seq

[SQL] How to prevent recursion

2002-08-20 Thread Falk Nisius
Hi, I try to save hierarchical Data with an id that contains strings which represent the way through the tree. On each depth level I can have a maxcount number of elements. If I want move subtrees, I have to change these id-fields. I want implement this as a RULE in the Database, that the using