[GENERAL] Bgwriter and pg_stat_bgwriter.buffers_clean aspects

2008-12-25 Thread Dmitry Koterov
Hello. I am trying to tune PostgreSQL write parameters to make writing operation fast on a heavy-loaded database (a lot of inserts/updates). After resetting the pg_stat_bgwriter statistics (I do it by deleting global/pgstat.stat file and restarting PostgreSQL) I monitor the following: # select *

[GENERAL] Bgwriter and pg_stat_bgwriter.buffers_clean aspects

2008-12-25 Thread Dmitry Koterov
Hello. I am trying to tune PostgreSQL write parameters to make writing operation fast on a heavy-loaded database (a lot of inserts/updates). After resetting the pg_stat_bgwriter statistics (I do it by deleting global/pgstat.stat file and restarting PostgreSQL) I monitor the following: # select *

[GENERAL] get the array value?

2008-12-25 Thread Victor Nawothnig
On Thu, Dec 25, 2008 at 7:15 AM, Charles.Hou wrote: > name[] = { JOHN , ALEX , TEST ,""} > > SQL : select name from table1 where 'TEST' = any (name) > > return: { JOHN , ALEX , TEST } > > in this sql command, how can i get the index of 'TEST' is 3 ? First of all. I assume the code above is meant

Re: [GENERAL] Many temporal schemas appearred on my DB

2008-12-25 Thread Angel Alvarez
El Jueves, 25 de Diciembre de 2008 Martijn van Oosterhout escribió: > On Thu, Dec 25, 2008 at 04:57:10PM +0100, Angel Alvarez wrote: > > Hi > > > > up to 5 chemas... pg_temp_n for (n=1..5) appearred on my pg 8.3 DB. > > > > pgadmin3 refuses to drop them so i have to open a sql editor and run "dro

Re: [GENERAL] Many temporal schemas appearred on my DB

2008-12-25 Thread Martijn van Oosterhout
On Thu, Dec 25, 2008 at 04:57:10PM +0100, Angel Alvarez wrote: > Hi > > up to 5 chemas... pg_temp_n for (n=1..5) appearred on my pg 8.3 DB. > > pgadmin3 refuses to drop them so i have to open a sql editor and run "drop > schema pg_tem...". > > Also some pg_toast_temp schemas got created... >

[GENERAL] Many temporal schemas appearred on my DB

2008-12-25 Thread Angel Alvarez
Hi up to 5 chemas... pg_temp_n for (n=1..5) appearred on my pg 8.3 DB. pgadmin3 refuses to drop them so i have to open a sql editor and run "drop schema pg_tem...". Also some pg_toast_temp schemas got created... ¿Why are created and how con i get rid of them without resorting to doing DROPS

Re: [GENERAL] Conditional commit inside functions

2008-12-25 Thread Asko Oja
On Thu, Dec 25, 2008 at 2:58 PM, Pavel Stehule wrote: > Hello, > > PostgreSQL has doesn't use rollback segment, so commit over 1 > lines is not necessary, and it is bad. If you are having database in your laptop it might be true. In OLTP environments it's not feasible to have large transacti

Re: [GENERAL] lack of consequence with domains and types

2008-12-25 Thread Grzegorz Jaśkiewicz
gj=# create domain dfoo as varchar(20) default 'bollocks' not null; CREATE DOMAIN Time: 1680,908 ms gj=# create table foo( a bigserial not null, b int default (random()*100)::int not null ); NOTICE: CREATE TABLE will create implicit sequence "foo_a_seq" for serial column "foo.a" CREATE TABLE Time

Re: [GENERAL] Conditional commit inside functions

2008-12-25 Thread Pavel Stehule
Hello, PostgreSQL has doesn't use rollback segment, so commit over 1 lines is not necessary, and it is bad. Regards Pavel Stehule 2008/12/25 Gerhard Wiesinger : > Hello! > > I want to translate the following Oracle PL/SQL script into plpgsql. > Especially I'm having problems with the transac

[GENERAL] Conditional commit inside functions

2008-12-25 Thread Gerhard Wiesinger
Hello! I want to translate the following Oracle PL/SQL script into plpgsql. Especially I'm having problems with the transaction thing. i tried START TRANSACTION and COMMIT without success. Any ideas? Thanx. Ciao, Gerhard CREATE OR REPLACE PROCEDURE insert_1Mio IS maxcommit NUMBER; BEGIN

Re: [GENERAL] Information about Pages, row versions of tables, indices

2008-12-25 Thread Pavel Stehule
Hello look on contrib module pg_stat_tuple http://www.postgresql.org/docs/8.3/interactive/pgstattuple.html regards Pavel Stehule 2008/12/25 Gerhard Wiesinger : > Hello! > > Is there some information in meta tables available about the number of pages > currently unused, row versions of tables and

[GENERAL] Information about Pages, row versions of tables, indices

2008-12-25 Thread Gerhard Wiesinger
Hello! Is there some information in meta tables available about the number of pages currently unused, row versions of tables and indices which are unused? I'm asking because I want to measure how efficient HOT is working and whether vacuum should be run or not saving diskspace (I know this i