Re: [SQL] ANSI SQL-99 SYNTAX and "WITH"

2004-06-04 Thread Tom Lane
Bruno Wolff III <[EMAIL PROTECTED]> writes: > Rein Petersen <[EMAIL PROTECTED]> wrote: >> As you may have guessed, I hope PostgreSQL currently supports the >> "WITH" clause syntax or, will at least support it imminently. > Postgres doesn't currently support that. Someone was working on it a while

Re: [SQL] ANSI SQL-99 SYNTAX and "WITH"

2004-06-04 Thread Bruno Wolff III
On Fri, Jun 04, 2004 at 15:37:41 -0400, Rein Petersen <[EMAIL PROTECTED]> wrote: > My research into PostgreSQL documentation has yet to yeild any information about > PostgreSQL's support of ANSI SQL-99 syntax, and in particular, the "WITH" clause - > which if I understand correctly, allows recu

Re: [SQL] ANSI SQL-99 SYNTAX and "WITH"

2004-06-04 Thread Yasir Malik
> Good morning,afternoon, and evening Everyone, > > My research into PostgreSQL documentation has yet to yeild any information about > PostgreSQL's support of ANSI SQL-99 syntax, and in particular, the "WITH" clause - > which if I understand correctly, allows recursive joins in simple syntax with

[SQL] ANSI SQL-99 SYNTAX and "WITH"

2004-06-04 Thread Rein Petersen
Good morning,afternoon, and evening Everyone,   My research into PostgreSQL documentation has yet to yeild any information about PostgreSQL's support of ANSI SQL-99 syntax, and in particular, the "WITH" clause - which if I understand correctly, allows recursive joins in simple syntax without

Re: [SQL] dynamic rules?

2004-06-04 Thread Bruno Wolff III
On Fri, Jun 04, 2004 at 09:16:04 -0700, Christopher Dedels <[EMAIL PROTECTED]> wrote: > Bruno, > > Thanks for the response. You should keep the discussion copied to the list as long as it is on topic. That way other people can help out. > I was wondering if I was possible to union the tables i

Re: [SQL] Difference between two times as a numeric value in a stored procedure.

2004-06-04 Thread Tom Lane
"Stijn Vanroye" <[EMAIL PROTECTED]> writes: > I can't seem to find a way to substract two time values (or > timestamp values) and get a numeric/float value. I always get the > INTERVAL datatype. extract(epoch from interval) may help. regards, tom lane

Re: [SQL] ERROR: duplicate key violates unique constraint

2004-06-04 Thread Josh Berkus
Khairul, > Need help on this problem. I've created two functions. The function > should perform a few sql processes. The problem is I got different > results when I call the function and when I manually run the sql command. > > I'm using postgresql 7.4.2. Hmmm ... that's odd. I remember getting

Re: [SQL] dynamic rules?

2004-06-04 Thread Bruno Wolff III
On Thu, Jun 03, 2004 at 21:32:47 -0700, Christopher Dedels <[EMAIL PROTECTED]> wrote: > Is it possible to create a select rule that returns results depending on a > where clause in the original select statement? > > For Example (oversimplified): > > CREATE TABLE one (data int); > CREATE TABLE t

[SQL] dynamic rules?

2004-06-04 Thread Christopher Dedels
Is it possible to create a select rule that returns results depending on a where clause in the original select statement? For Example (oversimplified): CREATE TABLE one (data int); CREATE TABLE two (data int); I make the query: SELECT data FROM number WHERE type=1; If the type is 1 (type=1) I w

Re: [SQL] Difference between two times as a numeric value in a stored procedure.

2004-06-04 Thread Bruno Wolff III
On Fri, Jun 04, 2004 at 10:11:57 +0200, Stijn Vanroye <[EMAIL PROTECTED]> wrote: > The working of the functions is not the problem, but the return type is. I can't > seem to find a way to substract two time values (or timestamp values) and get a > numeric/float value. I always get the INTERVAL

Re: [SQL] Difference between two times as a numeric value in a stored procedure. [Scanned]

2004-06-04 Thread Stijn Vanroye
> "Stijn Vanroye" <[EMAIL PROTECTED]> writes: > > I can't seem to find a way to substract two time values (or > > timestamp values) and get a numeric/float value. I always get the > > INTERVAL datatype. > > extract(epoch from interval) may help. > > regards, tom lane Indeed.

[SQL] trigger data

2004-06-04 Thread hook
Does any one have any reasonably simple application example that uses or parses the HeapTuple (PointerGetDatum(rettuple) ) returned by 'c' trigger function? Also, what is the syntax to parse the HeapTuple within the trigger function? thanks ---(end of broadcast)--

[SQL] ERROR: duplicate key violates unique constraint

2004-06-04 Thread Khairul Azmi
Need help on this problem. I've created two functions. The function should perform a few sql processes. The problem is I got different results when I call the function and when I manually run the sql command. I'm using postgresql 7.4.2. The two functions involved are CREATE TABLE sensor_signatur

[SQL] Difference between two times as a numeric value in a stored procedure.

2004-06-04 Thread Stijn Vanroye
Hello List, I am writing two stored procedure which alternatively returns the dayhours and nighthours of two times. (nighthours are considered between 00:00 and 06:00). As an example here is the getdayhours function: ---