[EMAIL PROTECTED] (javier garcia - CEBAS) writes: > I'm not an expert, not by far. > I've just installed postgres7.4 and have realized tat the order of rows in > queries in different to that in 7.3.4. It seems that previously it was more > logic, ordering by the first column, then by the second,... by default. > At least this is so in a couple of queries I have. And now I have to > explicitly say the order I want. > > Could someone just tell me why is this so?
You always had to explicitly state ORDER BY if you wanted to get a specific ordering; that's how SQL is designed. There are a number of cases where earlier versions of PostgreSQL had to perform specific sort procedures in order to perform GROUP BY queries, whereas 7.4 is able to use unordered hash tables to collect the data, thereby eliminating the sorts. That is quite likely to be the sort of thing that you are observing. If you want the data to be returned in a particular order, then you MUST state that order, otherwise you'll get whatever the database gives you, and yes, indeed, the ordering that is imposed implicitly can and does change. -- let name="cbbrowne" and tld="libertyrms.info" in String.concat "@" [name;tld];; <http://dev6.int.libertyrms.com/> Christopher Browne (416) 646 3304 x124 (land) ---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match