[SQL] PL/PGSQL TUTORIAL

2003-10-11 Thread Muhyiddin A.M Hayat
Where can i find a complete full terminated database schema in SQL?I want to see a real complete database schema with views, triggers.. etc,...  

Re: [SQL] PL/PGSQL TUTORIAL

2003-10-11 Thread Richard Huxton
On Saturday 11 October 2003 08:57, Muhyiddin A.M Hayat wrote: > Where can i find a complete full terminated database schema in SQL? > > I want to see a real complete database schema with views, triggers.. > etc,... Good places to start are: http://freshmeat.net/ http://sourceforge.net/ That's

Re: [SQL] PL/PGSQL TUTORIAL

2003-10-11 Thread Richard Huxton
On Saturday 11 October 2003 08:57, Muhyiddin A.M Hayat wrote: > Where can i find a complete full terminated database schema in SQL? > > I want to see a real complete database schema with views, triggers.. > etc,... Oh - while I'm thinking of it, a couple of applications it might be worth looking

[SQL] sql performance and cache

2003-10-11 Thread Chris Faulkner
Hello all I have two very similar queries which I need to execute. They both have exactly the same from / where conditions. When I execute the first, it takes about 16 seconds. The second is executed almost immediately after, it takes 13 seconds. In short, I'd like to know why the query result isn

Re: [SQL] sql performance and cache

2003-10-11 Thread Richard Huxton
On Saturday 11 October 2003 10:43, Chris Faulkner wrote: > Hello all > > I have two very similar queries which I need to execute. They both have > exactly the same from / where conditions. When I execute the first, it > takes about 16 seconds. The second is executed almost immediately after, it > t

Re: [SQL] sql performance and cache

2003-10-11 Thread Chris Faulkner
Hello Thanks for the reply. > The short answer is that PG doesn't cache query results. The only > way it could > do so safely is to lock all tables you access to make sure that no other > process changes them. That would effectively turn PG into a > single-user DB in > short notice. I am not sur

Re: [SQL] sql performance and cache

2003-10-11 Thread Richard Huxton
On Saturday 11 October 2003 12:12, Chris Faulkner wrote: > Hello > > Thanks for the reply. > > > The short answer is that PG doesn't cache query results. The only > > way it could > > do so safely is to lock all tables you access to make sure that no other > > process changes them. That would effec

[SQL] Running tally

2003-10-11 Thread Christopher Kings-Lynne
Hi guys, If I have a table that is just a single column full of numbers, how can I select all the rows from the table with a second column that is the running tally so far down the result set? eg: Num Tally so far 0.3 0.3 1.2 1.5 2.0 3.5 ... Does this require PL/PgSQL coding?

Re: [SQL] Running tally

2003-10-11 Thread Richard Huxton
On Saturday 04 October 2003 10:56, Christopher Kings-Lynne wrote: > Hi guys, > > If I have a table that is just a single column full of numbers, how can > I select all the rows from the table with a second column that is the > running tally so far down the result set? > > eg: > > Num Tally so f

Re: [SQL] Running tally

2003-10-11 Thread elein
You can use plpythonu (or tcl or C or R) to do running sums. For plpythonu, you must initialize the SD[] by calling it first with the proper argument. create or replace function runsum(int,int) returns int as ' if args[0] == 1: SD["currval"] = 0 return SD["currval"] else:

Re: [SQL] PL/PGSQL TUTORIAL

2003-10-11 Thread Roberto Mello
On Sat, Oct 11, 2003 at 10:36:10AM +0100, Richard Huxton wrote: > > Oh - while I'm thinking of it, a couple of applications it might be worth > looking at are OpenACS or Bricolage, both web-based content-management > systems. OpenACS is not a content management system, but it provides a couple