Re: [SQL] Jagged/ragged arrays

2010-09-21 Thread Florian Weimer
* 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 > > (

Re: [SQL] Jagged/ragged arrays

2010-09-21 Thread Dmitriy Igrishin
Hey Craig, Florian Ahh, this. Why not just yes NULLs as values of array? 2010/9/21 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[][]; > ERRO

Re: [SQL] all the table values equal

2010-09-21 Thread Michele Petrazzo - Unipex
Oliveiros d'Azevedo Cristina ha scritto: Hello again, Michele, Ciao, I haven't open my mailbox during weekend so I couldn't follow up your question. No problem! 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 u

Re: [SQL] all the table values equal

2010-09-21 Thread negora
I'm not sure if I understood you right, but it sounds similar to a case which I faced recently. Why not to use an inverse approach? In other words: trying to find those registries which hasn't got at least one value which differs from which you want to look for. How? Using the EXISTS function w

Re: [SQL] all the table values equal

2010-09-21 Thread Oliveiros d'Azevedo Cristina
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? Yes. Re-reading my post I saw that I could explain better! id_user | value

[SQL] Slow response in select

2010-09-21 Thread Gary Stainburn
Hi folks,I have a view that seems to be very slow compared to similar views on the same server. I've had a look at running explain but I don't really understand it. I've posted the view and the output from explain at http://www1.ringways.co.uk/explain.txt This is an old view on a database that

Re: [SQL] Slow response in select

2010-09-21 Thread Craig Ringer
On 09/21/2010 08:25 PM, Gary Stainburn wrote: Hi folks,I have a view that seems to be very slow compared to similar views on the same server. I've had a look at running explain but I don't really understand it. I've posted the view and the output from explain at http://www1.ringways.co.uk/expl

Re: [SQL] Slow response in select

2010-09-21 Thread Gary Stainburn
On Tuesday 21 September 2010 15:11:09 Craig Ringer wrote: > On 09/21/2010 08:25 PM, Gary Stainburn wrote: > > Hi folks,I have a view that seems to be very slow compared to similar > > views on the same server. > > > > I've had a look at running explain but I don't really understand it. > > > > I've

Re: [SQL] Slow response in select

2010-09-21 Thread Gary Stainburn
On Tuesday 21 September 2010 15:20:15 Gary Stainburn wrote: > > I've posted th explain analyze at > > http://www1.ringways.co.uk/explain_analyse.txt > > I've marked a line with a sort in that appears to be the bit that's taking > the time. Am I right? > I've had a look at this, and I can't even s

Re: [SQL] all the table values equal

2010-09-21 Thread Michele Petrazzo - Unipex
Oliveiros d'Azevedo Cristina ha scritto: OK, So, analysing your new question, the time interval is still important? Or no longer? It's important but simple to translate into sql, so I remove it from my question. So writting your query in english : "I want all users that don't change "value

Re: [SQL] all the table values equal

2010-09-21 Thread Oliveiros d'Azevedo Cristina
Howdy, Michele. Any news? Any progress/problems? If you want to find out all the id_users who don't change value in a given time interval you can use something like this. SELECT "id_user","value" FROM ( SELECT "id_user", COUNT(*) as total FROM t_yourtable WHERE "datetime" BETWEEN '2010-9-1' --

Re: [SQL] Slow response in select

2010-09-21 Thread Tom Lane
Gary Stainburn writes: > I've posted th explain analyze at > http://www1.ringways.co.uk/explain_analyse.txt > I've marked a line with a sort in that appears to be the bit that's taking > the > time. Am I right? Well, it's not really that big a part of the whole cost: only 150ms out of the tot

Re: [SQL] all the table values equal

2010-09-21 Thread Oliveiros d'Azevedo Cristina
Yes. All the users that have only one value into the "value" column and that value is NN. Understood. Try the query from the previous mail, adding the clause WHERE "value" = NN as I did explain. Or will you need to find all the users that don't change value with just one query? And the

[SQL] Help with queries.

2010-09-21 Thread Adrian Johnson
Dear group, I just started learning postgres and I have to analyze my data. So please bear with me, for all the simple questions that I am asking. Apologies. I have a table: snps table id | sample_id | chromosome | from | to | -

Re: [SQL] Help with queries.

2010-09-21 Thread Oliveiros d'Azevedo Cristina
Howdy, Adrian, Please see my questions below snps table id | sample_id | chromosome | from | to | 1 1chr1 10 11 2 1 chr1 14 15 3 2

[SQL] available RPM package for 8.4.4?

2010-09-21 Thread Joshua Gooding
Is it possible to just download the RPM package for postgresql server 8.4 for fedora and NOT install it through the yum tree? If so where can I go to get it. I am looking all through yum.pgrpms.org and I am coming up a bit short. Thanks. -- Joshua Gooding -- Sent via pgsql-sql mailing li

Re: [SQL] available RPM package for 8.4.4?

2010-09-21 Thread Devrim GÜNDÜZ
On Tue, 2010-09-21 at 13:53 -0400, Joshua Gooding wrote: > Is it possible to just download the RPM package for postgresql > server > 8.4 for fedora and NOT install it through the yum tree? Sure. You can grab the package from: http://yum.pgrpms.org/8.4/fedora/ Also, you can grab rpms from

Re: [SQL] Help with queries.

2010-09-21 Thread Adrian Johnson
Hello Oliver. thanks for your reply. Here are my answers. Sorry I shot e-mail in morning and I was not clear about it. I am afraid, I am not jamming you with all information. Thank you very much for your help. == your questions ==