Re: [SQL] Table returning functions

2010-09-20 Thread Jann Röder
True,
but it still allowed me to write queries that I do not know how to
express otherwise.

Am 20.09.10 01:58, schrieb Tom Lane:
> =?UTF-8?B?SmFubiBSw7ZkZXI=?=  writes:
>> Ok I now know that it really seems to do what I expected. But I still
>> wonder what it does if I use two functions f() and g() that return a
>> different number of rows.
> 
> You get the least common multiple of their periods.  It's ugly, and the
> lack of any very sane way to define the behavior is the main argument
> for deprecating SRFs in the targetlist.
> 
>   regards, tom lane
> 



-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


[SQL] Jagged/ragged arrays

2010-09-20 Thread Florian Weimer
It seems that PostgreSQL 8.4 does not support ragged arrays.  Is there
a workaround to get similar functionality (mainly the ability to
extract values in SQL expressions)?

-- 
Florian Weimer
BFK edv-consulting GmbH   http://www.bfk.de/
Kriegsstraße 100  tel: +49-721-96201-1
D-76133 Karlsruhe fax: +49-721-96201-99

-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


Re: [SQL] all the table values equal

2010-09-20 Thread Oliveiros d'Azevedo Cristina

Hello again, Michele,

I haven't open my mailbox during weekend so I couldn't follow up your 
question.


It would help if you explain a little better the background of the problem 
you're trying to solve.


You want to find all the user IDs which have the same value on a given time 
interval?


Is my understanding correct?

Best,
Oliver

- Original Message - 
From: "Michele Petrazzo - Unipex" 

To: "Oliveiros d'Azevedo Cristina" 
Cc: 
Sent: Friday, September 17, 2010 4:45 PM
Subject: Re: [SQL] all the table values equal



Oliveiros d'Azevedo Cristina ha scritto:

Howdy , Michele,

Give this a try

SELECT id_user FROM t_your_table WHERE datetime BETWEEN A -- plug
here beginning of interval AND B -- and end here GROUP BY id_user
HAVING COUNT(*) = -SUM(value)

Then tell me if it gives you what you want



Thanks,
it works, but... it's really a trickle that exploits the value -1 if I
understand how its work.
If there is another value where look for? Example 13?

Thanks

--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql 



--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


Re: [SQL] Jagged/ragged arrays

2010-09-20 Thread Dmitriy Igrishin
Hey Florian,

What do you mean by "ragged" arrays?

-- 
Regards,
Dmitriy


Re: [SQL] Jagged/ragged arrays

2010-09-20 Thread Craig Ringer

On 21/09/2010 3:42 AM, Dmitriy Igrishin wrote:

Hey Florian,

What do you mean by "ragged" arrays?


At a guess:

craig=> SELECT '{ {1}, {1,2}, {1}, {1,2,3} }'::integer[][];
ERROR:  multidimensional arrays must have array expressions with 
matching dimensions


(OP) Correct?

--
Craig Ringer

Tech-related writing at http://soapyfrogs.blogspot.com/

--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql