[SQL] Number timestamped rows

2011-11-02 Thread Jan Peters
Dear all, maybe a stupid question, but: I have a table that is ordered like this: user_id|timestamp|event 1 |0:1 |event_a 1 |0:2 |event_b 2 |0:1 |event_b 2 |0:3 |event_c 2 |0:4 |event_b 3 |0:1 |event_a and I would like to number them acc

Re: [SQL] How to hand over array as variable in plpgsql function?

2008-10-28 Thread Jan Peters
Hi Tom (and hello all again), thanks for your reply. > Seems like using EXECUTE is the hardest possible way to do this. Why > don't you just SELECT? > > SELECT id FROM precip_arrays WHERE b = precip_control INTO id_result; How should the code look like to do this? I am using EXECUTE because I

[SQL] How to hand over array as variable in plpgsql function?

2008-10-27 Thread Jan Peters
he right direction how to right this statement correctly, so that the array can be processed by this SQL statement? Thanks in advance and kind regards Jan Peters-Anders -- "Feel free" - 5 GB Mailbox, 50 FreeSMS/Monat ... Jetzt GMX ProMail testen: http://www.gmx.net/de/go/promail -- Se

[SQL] Problems with function while migrating from Windows to Linux

2008-04-22 Thread Jan Peters
ERROR: syntax error at or near "$4" at character 81 QUERY: SELECT 'SELECT getaktiva(' || $1 || ',' || $2 || ',' || $3 || ') ;' INTO $4 CONTEXT: PL/pgSQL function "getgv_neu" line 7 at execute statement What might be the problem

Re: [SQL] Rollback locks table - why?

2008-03-20 Thread Jan Peters
Yes, Tom, it looks like this: Locked Transaction:458553 I misread that. Sorry for that, I am actually a Geographer and just "using" the tools at hand. So I was not clear enough, it is a lock, but it's just the one of the transaction, right. That still does not explain why the Query Editor loc

Re: [SQL] Rollback locks table - why?

2008-03-20 Thread Jan Peters
Hm, Tom, your're right, it works in the console, but not in the editor window, strange... -- Pt! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your s

Re: [SQL] Rollback locks table - why?

2008-03-20 Thread Jan Peters
Hello Tom, > so the problem must be in something you didn't show us. What exactly > are you doing to decide that you need to roll back? Also, none of these > statements (except the CREATE) would take an exclusive lock on test, so > there must be something else going on that you didn't show us.

Re: [SQL] Rollback locks table - why?

2008-03-20 Thread Jan Peters
Hello Craig, > > Maybe you should tell the readers of this list a little more about what > you're trying to do and why? > -- ok, so I'll do that: I am programming a small economic Java simulation/serious game that has to calculate the GDP after 12 rounds. For doing this, I need the capital of

Re: [SQL] Rollback locks table - why?

2008-03-20 Thread Jan Peters
Hello Craig, > Jan Peters wrote: > > If I run the transaction block from above again I get first a unique key > violation (that is ok, because that's what I trying to check for) but > there is NO rollback to sp1, only the "Unique Key" error message and after >

[SQL] Rollback locks table - why?

2008-03-20 Thread Jan Peters
Hello list, I am a bit confused. See the code below: BEGIN; SAVEPOINT sp1; INSERT INTO test(id,runde) VALUES(2, 0); --if there is a unique key violstion: ROLLBACK TO sp1; UPDATE test SET id = 1000 WHERE runde = 0; COMMIT; When I first run this statement, I do not get any error message, but also

[SQL] Rollback locks table - why?

2008-03-20 Thread Jan Peters
Hello list, I am a bit confused. See the code below: BEGIN; SAVEPOINT sp1; INSERT INTO test(id,runde) VALUES(2, 0); --if there is a unique key violstion: ROLLBACK TO sp1; UPDATE test SET id = 1000 WHERE runde = 0; COMMIT; When I first run this statement, I do not get any error message, but also