Re: Select last there dates - Mailing list pgsql-sql

From A. Kretschmer
Subject Re: Select last there dates
Date
Msg-id 20070621132440.GM1405@a-kretschmer.de
Whole thread Raw
In response to Re: Select last there dates  ("Loredana Curugiu" <loredana.curugiu@gmail.com>)
Responses Re: [NOVICE] Select last there dates
List pgsql-sql
am  Thu, dem 21.06.2007, um 16:00:05 +0300 mailte Loredana Curugiu folgendes:
> So Andreas, would you please give some more explanations
> on your solution? I didn't work with functions and aggregate till
> now.

I will try it, but i'm not a nativ english speaker and thats why i have
some problems...

>
> I don't understand how this comma_aggregate works. I can see that this
> function it is defined with two arguments, but the aggredate it is called
> with a single argument.

An aggregate needs among others a so called 'SFUNC' with 2 parameters:
internal-state and next data item. It returns the next-internal-state.

This is explained here:
http://www.postgresql.org/docs/8.1/interactive/sql-createaggregate.html

>
> And what is LANGUAGE sql IMMUTABLE STRICT ?

An IMMUTABLE function can't modify the database
http://www.postgresql.org/docs/current/static/xfunc-volatility.html


STRICT:
http://www.postgresql.org/docs/8.2/static/xfunc-c.html

,----[  ]
| Notice that we have specified the functions as "strict", meaning that
| the system should automatically assume a null result if any input value
| is null.
`----



Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

pgsql-sql by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Select last there dates
Next
From: "Loredana Curugiu"
Date:
Subject: Re: Select last there dates