[SQL] Change in 9.1?

2011-11-21 Thread Jasmin Dizdarevic
Hi, we have a reporting tool, that sometimes uses this kind of condition. ...WHERE a.field = a.field To explain this: a.field can be filtered by the user. the user can choose some values. if he does, this condition will be build: ...WHERE a.field IN (1,2,3) If the user doesn't choose any values

Re: [SQL] Stuck Up In My Own Category Tree

2011-08-11 Thread jasmin . dizdarevic
I will have do something like this soon. Look at ltree. I don't have much experience with it yet, but it seems that this ext addresses those issues. Regards A1 präsentiert BlackBerry® von Vodafone -Original Message- From: Samuel Gendler Sender: pgsql-sql-owner@postgresql.orgDate: Thu, 11

Re: [SQL] Performance of NOT IN and <> with PG 9.0.4

2011-05-25 Thread Jasmin Dizdarevic
As I've understood the docs those 2 limits should not take effect, because the performance is going down when adding two aggregated columns, but only when enable_material is on. 2011/5/25 Tom Lane > Robert Haas writes: > > On Tue, May 24, 2011 at 3:32 PM, Jasmin Dizdare

Re: [SQL] Performance of NOT IN and <> with PG 9.0.4

2011-05-24 Thread Jasmin Dizdarevic
x Scan on facts_i0 (cost=0.00..59324.09 rows=42162 width=0) (actual time=246.394..246.394 rows=48484 loops=1) Index Cond: ((datum = '2011-03-31'::date) AND ((gruppe)::text = 'PASSIV'::text) AND ((produkt)::text = 'GESAMT'::text) AND ((eigenschaft)

Re: [SQL] Performance of NOT IN and <> with PG 9.0.4

2011-05-24 Thread Jasmin Dizdarevic
r, I can provide you more details. regards Jasmin 2011/5/24 Jasmin Dizdarevic > Hi, > > now I have an example and a query plan for 8.4 and 9.0.4. See the > differences! Performance with 9 is horrible. > I've eliminated the NOT-IN-Statements hoping it would be better, but th

Re: [SQL] Which version of PostgreSQL should I use.

2011-05-24 Thread Jasmin Dizdarevic
Alright, I've misunderstood this issue. Do you have to escape bytea columns during export or import? And how you would do this? Ty 2011/5/24 Craig Ringer > On 24/05/11 14:30, jasmin.dizdare...@gmail.com wrote: > > We had trbls with our drupal site, because some settings are stored in > bytea c

Re: [SQL] Performance of NOT IN and <> with PG 9.0.4

2011-05-24 Thread Jasmin Dizdarevic
:text = 'DEPOT'::text) AND ((produkt)::text = 'EIGEMI'::text) AND ((eigenschaft)::text = 'NOM'::text)) -> Sort (cost=74029.57..74039.91 rows=4138 width=23) Sort Key: mis.facts.kundnr -> Index Scan using facts

Re: [SQL] Which version of PostgreSQL should I use.

2011-05-23 Thread jasmin . dizdarevic
Just be careful with pg_dump, if you have binary data stored in your 8.4 db. In default mode it just export text. Jasmin A1 präsentiert BlackBerry® von Vodafone -Original Message- From: Gavin Baumanis Sender: pgsql-sql-owner@postgresql.orgDate: Sun, 22 May 2011 09:10:17 To: Gavin Bauma

[SQL] Performance of NOT IN and <> with PG 9.0.4

2011-05-16 Thread Jasmin Dizdarevic
Hi, is there a reason why Not IN-performance is so poor in 9.0.4 compared to 8.4? Ty Jasmin

Re: [SQL] joining one record according to max value

2011-01-12 Thread Jasmin Dizdarevic
( select name, max(score) as mxs from level group by 1 ) nm on i.mxscore = nm.mxs 2011/1/12 George Francis > Close! but I need the name of the LEVEL with highest score, and I dont > think I can get it this way. > Thanks for trying though! > > > On Wed, Jan 12, 2011 at 5:49 PM,

Re: [SQL] joining one record according to max value

2011-01-12 Thread Jasmin Dizdarevic
ROM-clause entry for table "source" > > SQL state: 42P01 > > Hint: There is an entry for table "source", but it cannot be referenced > from this part of the query. > > Character: 601 > > > On Wed, Jan 12, 2011 at 5:35 PM, Jasmin Dizdarevic < >

Re: [SQL] return records with more than one occurrences

2011-01-07 Thread Jasmin Dizdarevic
Hi, this is a good point to start. select t2.* from table2 t2 inner join ( select id from table1 group by id having count(*) > 1 ) t1 on t2.id_table1 = t1.id 2011/1/5 Tarsis Lima > how would the SELECT to return only records with more than one > occurrences of id_table1? example: > --

Re: [SQL] on error resume next

2009-07-31 Thread Jasmin Dizdarevic
Hi, that's not really that what i need. I think i will solve it on client side. thank you. jasmin 2009/7/31 Andreas Wenk > Jasmin Dizdarevic wrote: > >> hi, >> can i use savepoints to realize something like "on error resume next"? >> i've

[SQL] on error resume next

2009-07-31 Thread Jasmin Dizdarevic
hi, can i use savepoints to realize something like "on error resume next"? i've got the following situation: begin; 1. create view user001.accounts as select * from base.accounts; 2. grant select on user001.accounts to loginuser001; commit; begin; 3. create view user002.accounts as select * fr

Re: [SQL] Tweak sql result set... ?

2009-07-30 Thread Jasmin Dizdarevic
i think jasen is thinking of manipulating the result set in your programming enviroment not in the database. btw from the point of "clean programming" it's a bad idea to integrate html-elements directly into your database quereis. you're mixing data layer and design layer. what do you mean with so

Re: [SQL] Timestamp with timezone with Default value

2009-07-18 Thread Jasmin Dizdarevic
Hi, i think: create. ...( myCol timestamp with timezone default now() ) the function now() returns a timestamp with timezone ( http://www.postgresql.org/docs/8.4/static/functions-datetime.html) i currently have no db to test it - but it should work. jasmin 2009/7/18 Gianvito Pio > Hi all,

Re: [SQL] Sequences

2009-07-04 Thread Jasmin Dizdarevic
Nice Information. Does somebody know how to get the complete create-statement of an existing table/view? 2009/7/3 Chris Browne > Andre Rothe writes: > > Where are stored the sequence information? How I can query the > > properties of a sequence like increment, max/min value, cache? > > I'm look

Re: [SQL] Create custom aggregate function and custom sfunc

2009-07-03 Thread Jasmin Dizdarevic
Hi, thank you everybody for your help. The classy solution posted by nha works great! Regards Jasmin 2009/7/3 nha > Hello, > > Le 2/07/09 23:21, Greg Stark a écrit : > > On Thu, Jul 2, 2009 at 3:48 PM, Jasmin >> Dizdarevic wrote: >> >>> customer ; seg &g

[SQL] Create custom aggregate function and custom sfunc

2009-07-02 Thread Jasmin Dizdarevic
hi, i have to create a aggregate function which evaluates a maximum text value but with some conditions i have to take care of. is there a way to access a value set of each group? e.g.: customer ; seg 111 ; L1 111 ; L2 111 ; L1 222 ; L3 222 ; L3 222 ; L2 the result should look like this: 111: