Re: [GENERAL] Feature discussion: Should syntax errors abort a transaction?

2012-06-19 Thread Rainer Pruy
Hm, sorry but I still can not get into that argument. Take your example 3 (COMINT in place of COMMIT) How should the DB know that (and how) to safely recover from such error? You need to tell - and there are tools to do so right available. In an interactive session: - use "autocommit=on" to indi

Re: [GENERAL] Postgresql Error ask for password

2012-08-31 Thread Rainer Pruy
On 31.08.2012 16:29, José Pedro Santos wrote: > Dear all, > > Im trying to install one application in my Linux but when I try to use > the expression SU postgresql it ask for password, what is the > password? I try my root password but dont work. Sorry, you are a bit terse on the context of this.

Re: [GENERAL] Create loop in postgresql

2012-09-03 Thread Rainer Pruy
And probably the op would prefer to avoid recalculating the sum once for every row. select name,ges_kw_zgb, round(100*ges_kw_zgb/total.totalsum, 2) as z from energie.tennet_auswertung_2010, (select sum(ges_kw_zgb) totalsum >From energie.tennet_auswertung_2010) as total where .. Regards R

Re: [GENERAL] Create loop in postgresql

2012-09-03 Thread Rainer Pruy
Try it with parentheses around the (SELECT). On 03.09.2012 18:06, Robert Buckley wrote: > this give an error. > > select name,ges_kw_zgb, SELECT round(100 * (ges_kw_zgb / (select > sum(ges_kw_zgb) From energie.tennet_auswertung_2010)),2); > > ERROR: syntax error at or near "SELECT" > LINE 2:

[GENERAL] UPDATE...RETURNING col INTO var - what is returned?

2010-05-27 Thread Rainer Pruy
Hi all, I just got quite confused on the exact semantics of "RETURNING expressions INTO target" with an update statement. And while trying to resolve failed to find an answer in the docs. Question was whether - in case "expression" is involving a column that is assigned by the update itself - t

Re: [GENERAL] UPDATE...RETURNING col INTO var - what is returned?

2010-05-28 Thread Rainer Pruy
t) or using values written by other transactions (if transaction separation would allow; might not be save anyway)) So returning "old" values would have provided access to additional information, right? Rainer Am 27.05.2010 19:12, schrieb Alban Hertroys: > On 27 May 2010, at 18:12

Re: [GENERAL] is a 'pairwise' possible / feasible in SQL?

2008-08-04 Thread Rainer Pruy
Rajarshi Guha wrote > > On Aug 4, 2008, at 4:55 PM, Francisco Reyes wrote: >> On 2:08 pm 08/04/08 Rajarshi Guha <[EMAIL PROTECTED]> wrote: >>> paircount >>> - - >>> 123 & 456 1 >>> 667 & 879 2 > > > >> select a.cid as ac, b.cid as bc, count(*) from aic_cid a left

Re: [GENERAL] Annoying Reply-To

2008-10-17 Thread Rainer Pruy
Sigh... wasting another junk of bandwidth with this bike shed discussion Granted, replying here is more annoying and less convenient compared to other lists - as long as your MUA still does not provide decent support for mailing lists. Down back from 1998 is RFC 2369 that defined additional

Re: [GENERAL] Advantage of more than 1 tablespace on 1 disk?

2008-11-03 Thread Rainer Pruy
Hi Thom, table spaces are not in the first place related with addressing usage pattern of individual tables. They are a mechanism for putting up a *logical* layout of persistent storage. As such they are describing segments of persistence storage that will (or "might from the point of view of th

Re: [GENERAL] How to split up phone numbers?

2012-02-20 Thread Rainer Pruy
Dear Andreas, this will basically require some external knowledge about the numbers logic. The Format is not so a problem in the first place. Numbers that start with national prefix will either start with "00" or "+" followed by the 2 or 3 digit international prefix. City part is of variable lengt

Re: [GENERAL] Problem with initdb and two versions on one server?

2012-02-28 Thread Rainer Pruy
Hello Chris, can not provide much help. But definitely the message sounds like case (1) (8.3 server accessing 7.4 files) I did encounter such with two occasions: a) used an old initdb version b) using an rc script that had hard coded path to the (old) data directory both cases seem not to appl

Re: [GENERAL] can these queries be combined into one?

2012-03-26 Thread Rainer Pruy
Solution heavily depends on the relation of products and othertable. If ordercode at most has a single match with ordercode from othertable, then a simple left join and a coalesce() or CASE in the select list will do ( SELECT p.ordercode, p.descr, CASE WHEN t.codes is NULL THEN p.ordercode ELSE t