Re: [SQL] aggregate function

2010-08-03 Thread Tom Lane
=?UTF-8?Q?Viktor_Bojovi=C4=87?= writes: > I tried to write this part below, but something is wrong (ERROR: function > grafika.pov_sphere(character varying, numeric, numeric, numeric, numeric, > character varying) does not exist) so I wanted to ask if someone knows how > to solve this problem. Wel

[SQL] aggregate function

2010-08-03 Thread Viktor Bojović
I am trying to make aggregate function of existing function which looks like this. CREATE OR REPLACE FUNCTION "grafika"."pov_sphere" (x numeric, y numeric, z numeric, rad numeric, pigment varchar) RETURNS varchar AS $body$ DECLARE _pov varchar; BEGIN _pov:='sphere {<'||x||','||y||','||z||'>,'||rad|

Re: [SQL] Aggregate function to build 2-d array

2006-11-15 Thread chrisj
Hi Steven, I believe I saw something about a fix to array_append in the release notes for V8.2. Not sure if this helps. Steven Murdoch-2 wrote: > > I would like to aggregate several rows of a query, maintaining the > relative order. Is there an other way to achive the same result? I > have a

[SQL] Aggregate function to build 2-d array

2006-11-15 Thread Steven Murdoch
I would like to aggregate several rows of a query, maintaining the relative order. Is there an other way to achive the same result? I have an alternative construction, but I am not convinced it will work in all cases. For example, with the setup below: -- Concatenate elements of type t into arra

Re: [SQL] Aggregate Function with Argument

2004-10-25 Thread David Siegal
Mark, Works beautifully. Thanks for the clear explanation and code! -David On Tue, 19 Oct 2004, Mark Gibson wrote: > David Siegal wrote: > > I would like to create an aggregate function that returns a concatenation > > of grouped values. It would be particularly useful if I could pass an > > op

Re: [SQL] Aggregate Function with Argument

2004-10-19 Thread Mark Gibson
David Siegal wrote: I would like to create an aggregate function that returns a concatenation of grouped values. It would be particularly useful if I could pass an optional delimiter into the aggregate function. I've managed to do this in two stages: 1. Collect the set of values into an array. T

Re: [SQL] Aggregate Function with Argument

2004-10-18 Thread Bruno Wolff III
On Mon, Oct 18, 2004 at 11:24:33 -0400, David Siegal <[EMAIL PROTECTED]> wrote: > > My problem is I don't see how to make aggregated_concat accept an > optional delimiter argument. > Maybe it's not possible? > > Any ideas? > Is there some completely different approach I should consider for > co

[SQL] Aggregate Function with Argument

2004-10-18 Thread David Siegal
I would like to create an aggregate function that returns a concatenation of grouped values. It would be particularly useful if I could pass an optional delimiter into the aggregate function. For example: With a table, 'team'... team_numbermember_name -- 1

Re: [SQL] aggregate function stddev

2004-09-10 Thread Bruce Momjian
Is this a TODO? --- Josh Berkus wrote: > Kemin, > > > Just noticed that the postgres stddev is the stddev_sample formula. > > There are two different ways to calculate this value. > > Their difference is very small with lar

Re: [SQL] aggregate function stddev

2004-09-09 Thread Josh Berkus
Kemin, > Just noticed that the postgres stddev is the stddev_sample formula. > There are two different ways to calculate this value. > Their difference is very small with large samle size. It would be nice > to distinguish the two different versions. Note sent to PGSQL-DOCS. > I also noticed th

[SQL] aggregate function stddev

2004-09-08 Thread Kemin Zhou
Implementers: Just noticed that the postgres stddev is the stddev_sample formula. There are two different ways to calculate this value. Their difference is very small with large samle size. It would be nice to distinguish the two different versions. I also noticed that oracle has stddev_sampl

Re: [SQL] Aggregate function error in 7.4

2004-01-28 Thread j knight
Tom Lane wrote: j knight <[EMAIL PROTECTED]> writes: [ query with GROUP BY on a FULL JOIN USING column ] psql:pgsql.dump:301: ERROR: column "r.day" must appear in the GROUP BY clause or be used in an aggregate function Argh. This is the result of a thinko in an optimization added in 7.4. The

Re: [SQL] Aggregate function error in 7.4

2004-01-28 Thread Tom Lane
j knight <[EMAIL PROTECTED]> writes: > [ query with GROUP BY on a FULL JOIN USING column ] > psql:pgsql.dump:301: ERROR: column "r.day" must appear in the GROUP BY > clause or be used in an aggregate function Argh. This is the result of a thinko in an optimization added in 7.4. The patch is att

[SQL] Aggregate function error in 7.4

2004-01-27 Thread j knight
Hi all. I'm trying to migrate from 7.3.4 to 7.4.1. I've performed a pg_dumpall using the pg_dumpall from 7.4.1. Once 7.4 is running and I try to import the dump, I get the following error: psql:pgsql.dump:301: ERROR: column "r.day" must appear in the GROUP BY clause or be used in an aggregate