Re: [GENERAL] basic question (shared buffers vs. effective cache

2004-05-10 Thread scott.marlowe
On Mon, 10 May 2004, Jack Orenstein wrote: scott.marlowe wrote: shared_buffers is the amount of space postgresql can use as temp memory space to put together result sets. It is not intended as a cache, and once the last backend holding open a buffer space shuts down, the

Re: [GENERAL] Very slow query

2004-05-10 Thread Rory Campbell-Lange
Sorry for replying to my own post, but I'm anxious for an answer. Should I provide other information? Thanks Rory On 10/05/04, Rory Campbell-Lange ([EMAIL PROTECTED]) wrote: The following query on some small datasets takes over a second to run. I'd be grateful for some help in understanding

Re: [GENERAL] nested elseif woes

2004-05-10 Thread Ivan Sergio Borgonovo
On Mon, 10 May 2004 13:56:39 -0500 (EST) Kris Jurka [EMAIL PROTECTED] wrote: On Mon, 10 May 2004, Ivan Sergio Borgonovo wrote: Now let's come to the problem: create or replace function testa( ) returns char(32) as ' begin if 1=2 then if 1=2 then

Re: [GENERAL] Very slow query

2004-05-10 Thread Nick Barr
[snip] Rory Campbell-Lange wrote: SELECT DISTINCT b.n_id as id, b.n_type, CASE b.n_type WHEN 0 THEN 'personal' WHEN 1 THEN 'private' WHEN 2 THEN 'blog' ELSE 'public'

Re: [GENERAL] Interpreting vacuum verbosity

2004-05-10 Thread Tom Lane
Ed L. [EMAIL PROTECTED] writes: If it were indeed the case that we'd leaked a lot of diskspace, then after bumping max_fsm_pages up to a much higher number (4M), will these pages gradually be remembered as they are accessed by autovac and or queried, etc? Or is a dump/reload or 'vacuum

Re: [GENERAL] nested elseif woes

2004-05-10 Thread Steve Atkins
On Tue, May 11, 2004 at 12:58:55AM +0200, Ivan Sergio Borgonovo wrote: thanks to everyone. Curiously enough, trying to figure out what was wrong with my code, I've been able to write versions with the wrong spelling that didn't complain. That brought me astray. Anyway does anyone know any

Re: [GENERAL] vacuumdb is failing with NUMBER OF INDEX TUPLES NOT

2004-05-10 Thread Tom Lane
Andrew Sullivan [EMAIL PROTECTED] writes: Dunno if this is any help, but on a 7.2 system I saw a REINDEX which was interrupted leave the index at least partially working. We ended up with an index which seemed fine, but which didn't contain certain rows (so those rows were not visible when

[GENERAL] query of database to get permitted users list

2004-05-10 Thread pw
Hello, I have a query of pg_database to find the owners of each available database. How can I query to get the users that have permissions on any particular database? pg_user always contains *all* database users regardless of whether they have granted permissions to the current db. Thanks for

[GENERAL] passing strings to functions

2004-05-10 Thread Ivan Sergio Borgonovo
I can't understand how to pass strings to functions. create type tSession as ( SessionCode char(32), SessionID char(32), UserIDI integer, SessionN integer ); create or replace function GetSessionCode( char(32), smallint, boolean, varchar(128) ) returns tSession as ' declare

[GENERAL] Cancel query based on a timeout

2004-05-10 Thread Stijn Vanroye
Hi List, I'm running a query on a not-so-small db. Mostly this query runs fast enough, but every once in a while the query takes a long time to complete in wich case the users start banging away on the keyboard :-). What we would like to do is cancel the query after a certain time-out (e.g.

Re: [GENERAL] Cancel query based on a timeout

2004-05-10 Thread Shridhar Daithankar
Stijn Vanroye wrote: Hi List, I'm running a query on a not-so-small db. Mostly this query runs fast enough, but every once in a while the query takes a long time to complete in wich case the users start banging away on the keyboard :-). What we would like to do is cancel the query after a

Re: [GENERAL] full tuple count in cursor.

2004-05-10 Thread Tom Lane
Alexander Cohen [EMAIL PROTECTED] writes: I have a cursor that i got from a select statement. I would like to know how many records are in the cursor so i dont go over the last one when using FETCH on the cursor. How can i do this? You can't. The system does not know how many rows will be

Re: [GENERAL] passing strings to functions

2004-05-10 Thread Tom Lane
Ivan Sergio Borgonovo [EMAIL PROTECTED] writes: I can't understand how to pass strings to functions. Your problem isn't with the strings, it's with the smallint parameter. The undecorated 1 is an integer not a smallint, and it won't be silently cast in this particular scenario. Is there a

Re: [GENERAL] Cancel query based on a timeout

2004-05-10 Thread Tom Lane
Stijn Vanroye [EMAIL PROTECTED] writes: Is there some way to send a command to the postgres sever to stop running the query? There's a statement_timeout parameter in recent releases. I forget whether 7.3 has it though... regards, tom lane

Re: [GENERAL] Cancel query based on a timeout

2004-05-10 Thread Stijn Vanroye
Thanks for the reply Shridhar and Tom. But am I mistaken if setting this timeout parameter would affect all query's? That would not be the desired result. What I would like is to stop the execution of a specific (active) query if it is taking to long. If I execute the query, and it starts

Re: [GENERAL] Cancel query based on a timeout

2004-05-10 Thread Shridhar Daithankar
Stijn Vanroye wrote: Thanks for the reply Shridhar and Tom. But am I mistaken if setting this timeout parameter would affect all query's? That would not be the desired result. What I would like is to stop the execution of a specific (active) query if it is taking to long. If I execute the query,