Re: [GENERAL] (Never?) Kill Postmaster?

2007-10-23 Thread Christian Schröder
Ow Mun Heng wrote: look for the query's procpid and then issue a select pg_cancel_backend('the_id') Does it do any harm if I kill (either with signal 9 or signal 15) the single backend process (and not the postmaster)? Regards, Christian -- Deriva GmbH Tel.: +4

Re: [GENERAL] (Never?) Kill Postmaster?

2007-10-23 Thread Tommy Gildseth
Pavel Stehule wrote: 2007/10/24, Stefan Schwarzer <[EMAIL PROTECTED]>: I read dozens of times the "TIP 2: Don't 'kill -9' the postmaster"... Now, what am I supposed to do if I launched a query which takes ages, and which I want to interrupt? you have to use more gently way select pg_cancel

Re: [GENERAL] function result cache for pl/pgsql

2007-10-23 Thread Pavel Stehule
2007/10/24, Peter Manchev <[EMAIL PROTECTED]>: > > I was thinking about pl/pgsql and comparing it with pl/sql function result > cache, > featured in Oracle 11g - see > > http://www.oracle.com/technology/oramag/oracle/07-sep/o57plsql.html > > Is it possible to get pl/pgsql function result cache fun

Re: [GENERAL] (Never?) Kill Postmaster?

2007-10-23 Thread Ow Mun Heng
On Wed, 2007-10-24 at 07:57 +0200, Stefan Schwarzer wrote: > Hi there, > > > I read dozens of times the "TIP 2: Don't 'kill -9' the postmaster"... > > > Now, what am I supposed to do if I launched a query which takes ages, > and which I want to interrupt? look for the query's procpid and th

Re: [GENERAL] (Never?) Kill Postmaster?

2007-10-23 Thread Pavel Stehule
2007/10/24, Stefan Schwarzer <[EMAIL PROTECTED]>: > Hi there, > > I read dozens of times the "TIP 2: Don't 'kill -9' the postmaster"... > > Now, what am I supposed to do if I launched a query which takes ages, and > which I want to interrupt? > > Thanks for any advice, > > Stef > Hello you have t

[GENERAL] (Never?) Kill Postmaster?

2007-10-23 Thread Stefan Schwarzer
Hi there, I read dozens of times the "TIP 2: Don't 'kill -9' the postmaster"... Now, what am I supposed to do if I launched a query which takes ages, and which I want to interrupt? Thanks for any advice, Stef Stefan S

[GENERAL] function result cache for pl/pgsql

2007-10-23 Thread Peter Manchev
I was thinking about pl/pgsql and comparing it with pl/sql function result cache, featured in Oracle 11g - see http://www.oracle.com/technology/oramag/oracle/07-sep/o57plsql.html Is it possible to get pl/pgsql function result cache functionality into PostgreSQL? I am not that familiar with th

Re: [GENERAL] Using Postgres as a "embedded" / SQL Lite database on Windows

2007-10-23 Thread Scott Marlowe
On 10/23/07, Craig Hawkes <[EMAIL PROTECTED]> wrote: > Hi Everyone I have a question re using postgres as a "embedded" database on > Windows. This question gets asked about once every three months. Searching the archives should turn up some previous discussions on the subject. > First a little b

[GENERAL] Using Postgres as a "embedded" / SQL Lite database on Windows

2007-10-23 Thread Craig Hawkes
Hi Everyone I have a question re using postgres as a "embedded" database on Windows. First a little background: I have been using Postgres for a number of years on Linux, and it is great. I am now working with a company which develops Windows software using Delphi. This has been successful and the

Re: [GENERAL] Start DB giving fatal message.(linux)

2007-10-23 Thread Scott Marlowe
On 10/23/07, Farhan Khan <[EMAIL PROTECTED]> wrote: > Because of some OS failure I have to reinstall linux and postgres and now > database start gives me following error message. Any pointers will be > apprciated ... > > [EMAIL PROTECTED]:postgresql-8.2.5$ /usr/local/pgsql/bin/postgres -D > /usr/l

[GENERAL] Start DB giving fatal message.(linux)

2007-10-23 Thread Farhan Khan
Because of some OS failure I have to reinstall linux and postgres and now database start gives me following error message. Any pointers will be apprciated ... [EMAIL PROTECTED]:postgresql-8.2.5$ /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data LOG: database system was shut down at 2007-10-

[GENERAL] Extracting Index Creation Script

2007-10-23 Thread Paul Silveira
Hello, Does anyone have any good code to extract the metadata needed to create indexes on a specific table? The Client Tools (like pgadmin-III) presents that code so I'm sure it's extractable but could not find it in my trace that I ran while operating pgadmin... Thanks in advance, Paul -- V

Re: [GENERAL] data statistic functions

2007-10-23 Thread Tom Lane
Kevin Hunter <[EMAIL PROTECTED]> writes: > On a side note, I also noted that I couldn't immediately spot AVG, MAX, > or MIN in the output of \df. \df explicitly excludes aggregate functions. Try \da. regards, tom lane ---(end of broadcast)

Re: [GENERAL] Bitmap Heap scan 8.1/8.2

2007-10-23 Thread Tom Lane
Martin Marques <[EMAIL PROTECTED]> writes: > Ok, now the 8.1 server has a RAID1 hardware board with SCSI disks, and > the 8.2 is just a PentiumD with SATA disks (it's my desktop PC where I > do tests). Should I have a lower random_page_cost on a machine that is > likely to have a lower disk IO s

Re: [GENERAL] data statistic functions

2007-10-23 Thread Kevin Hunter
At 4:53p -0400 on 23 Oct 2007, Steve Atkins wrote: > There's probably some interesting stuff if you look at PL/R too ( > http://pgfoundry.org/projects/plr/ ). PL/R . . . that looks promising. Thanks. Kevin ---(end of broadcast)--- TIP 3: Have you

Re: [GENERAL] data statistic functions

2007-10-23 Thread Steve Atkins
On Oct 23, 2007, at 1:43 PM, Kevin Hunter wrote: Hullo List, What does Postgres offer in terms of statistics support (not the statistics about the database, but functions to operate on the data). I know there are simple things like AVG, COUNT, MAX, and MIN, but what else? I'm not sure whe

Re: [GENERAL] data statistic functions

2007-10-23 Thread Joshua D. Drake
On Tue, 23 Oct 2007 16:43:04 -0400 Kevin Hunter <[EMAIL PROTECTED]> wrote: > Hullo List, > > What does Postgres offer in terms of statistics support (not the > statistics about the database, but functions to operate on the data). > > I know there are simple things like AVG, COUNT, MAX, and MIN,

[GENERAL] data statistic functions

2007-10-23 Thread Kevin Hunter
Hullo List, What does Postgres offer in terms of statistics support (not the statistics about the database, but functions to operate on the data). I know there are simple things like AVG, COUNT, MAX, and MIN, but what else? I'm not sure where to begin looking, other than a cursory inspection of

Re: [GENERAL] newbie: update timestamp trigger?

2007-10-23 Thread Scott Marlowe
On 10/23/07, ahnf <[EMAIL PROTECTED]> wrote: > Whenever a row is updated in a table with a timestamp column. How do I write > a trigger to set that timestamp column to now() or the current timestamp? You should be able to take a virtual chainsaw to the example on this page and do it: http://www.

Re: [GENERAL] newbie: update timestamp trigger?

2007-10-23 Thread Rodrigo De León
On 10/23/07, ahnf <[EMAIL PROTECTED]> wrote: > Whenever a row is updated in a table with a timestamp column. How do I write > a trigger to set that timestamp column to now() or the current timestamp? Straight from the horse's mouth: http://www.postgresql.org/docs/8.2/static/plpgsql-trigger.html#P

[GENERAL] newbie: update timestamp trigger?

2007-10-23 Thread ahnf
Whenever a row is updated in a table with a timestamp column. How do I write a trigger to set that timestamp column to now() or the current timestamp? thanks ---(end of broadcast)--- TIP 6: explain analyze is your friend

[GENERAL] Service pgsql-8.1 failed to start

2007-10-23 Thread Josi Perez
I'm trying install PostgreSQL-8.1.10 (binary format) in an external HD (USB connection) under Windows XP SP2. 1) If I try to install postgres as a service I receive the message "Service failed to start; verify if you have sufficient privileges to start system services" I'm running the installati

Re: [GENERAL] 8.2.3: Server crashes on Windows using Eclipse/Junit

2007-10-23 Thread Magnus Hagander
Rainer Bauer wrote: > After increasing the session heap size in the registry from 512KB to 1024KB > the no. of connections was roughly doubled. So this might be a solution for > people running out of Desktop heap. > > Alter the value of the following key > > > The numeric values following "Share

Re: [GENERAL] Bitmap Heap scan 8.1/8.2

2007-10-23 Thread Martin Marques
Alvaro Herrera wrote: It's an arbitrary number, based on which all the other numbers are measured. Now that I read more intensively he docs I see that all the cost parameters are related one with the other. What people generally do around here is mess with random_page_cost, and leave seq_p

Re: [GENERAL] 8.2.3: Server crashes on Windows using Eclipse/Junit

2007-10-23 Thread Trevor Talbot
On 10/23/07, Rainer Bauer <[EMAIL PROTECTED]> wrote: > "Trevor Talbot" wrote: > >It could be that there's a significant difference between XP and 2003 > >in how that's handled though. I do have an XP SP2 machine here with > >512MB RAM, and I'll try tests on it as soon as I can free up what it's >

Re: [GENERAL] 8.2.3: Server crashes on Windows using Eclipse/Junit

2007-10-23 Thread Trevor Talbot
On 10/23/07, Harald Armin Massa <[EMAIL PROTECTED]> wrote: > > The Desktop Heap appears to be a place for processes belonging to the same > > "desktop" to allocate shared objects such as GUI elements. These are > > allocated > > in shared space so they can be manipulated by any process running in

[GENERAL] can't compile Pl/Java

2007-10-23 Thread Roger Mason
hello, I need to install Pl/java in my 8.0.12 PostgreSQL. According to the documentation on the PL/java wiki I must compile from source. When I run make the following errors occur: make[1]: Entering directory `/usr/local/share/pljava-1.3.0/build/classes/pljava' make[1]: Nothing to be done for `

Re: [GENERAL] 8.2.3: Server crashes on Windows using Eclipse/Junit

2007-10-23 Thread Dave Page
Harald Armin Massa wrote: > Replying to myself >> Postgres is definitely NOT started as LocalSystem account; so using a >> "logical not" on Microsofts Words that could indicate the reason why >> our service-backends consume that memory? Add to this that MS SQL runs >> as LocalSystem; and as muc

Re: [GENERAL] 8.2.3: Server crashes on Windows using Eclipse/Junit

2007-10-23 Thread Harald Armin Massa
Replying to myself > Postgres is definitely NOT started as LocalSystem account; so using a > "logical not" on Microsofts Words that could indicate the reason why > our service-backends consume that memory? Add to this that MS SQL runs > as LocalSystem; and as much as I know also Oracle. just s

Re: [GENERAL] 8.2.3: Server crashes on Windows using Eclipse/Junit

2007-10-23 Thread Harald Armin Massa
> > why does every backend need its own heap for user32.dll or > > shell32.dll? Wasn't the point of shared dlls to be shared? > > The Desktop Heap appears to be a place for processes belonging to the same > "desktop" to allocate shared objects such as GUI elements. These are allocated > in shared s

Re: [GENERAL] 8.2.3: Server crashes on Windows using Eclipse/Junit

2007-10-23 Thread Dave Page
Harald Armin Massa wrote: > Dave, > >> It's coming from direct dependencies on user32.dll (from which we use >> wsprintf()) and shell32.dll (from which we use SHGetSpecialFolderPath()) >> and is allocated when ResumeThread() is called to kickstart the new >> backend, > > why does every backend ne

Re: [GENERAL] 8.2.3: Server crashes on Windows using Eclipse/Junit

2007-10-23 Thread Gregory Stark
"Harald Armin Massa" <[EMAIL PROTECTED]> writes: > Dave, > >> It's coming from direct dependencies on user32.dll (from which we use >> wsprintf()) and shell32.dll (from which we use SHGetSpecialFolderPath()) >> and is allocated when ResumeThread() is called to kickstart the new >> backend, > > wh

Re: [GENERAL] 8.2.3: Server crashes on Windows using Eclipse/Junit

2007-10-23 Thread Harald Armin Massa
Dave, > It's coming from direct dependencies on user32.dll (from which we use > wsprintf()) and shell32.dll (from which we use SHGetSpecialFolderPath()) > and is allocated when ResumeThread() is called to kickstart the new > backend, why does every backend need its own heap for user32.dll or shel

Re: [GENERAL] autovacuum and locks

2007-10-23 Thread Alvaro Herrera
Dietmar Maurer wrote: > > > Anyways, i am trying to avoid locks now, by using my own merge > > > function to avoid update/insert race condition. > > > > > > Or what is the suggested way to avoid the update/insert > > race condition?. > > > > What update/insert race condition? Maybe you are tal

Re: [GENERAL] 8.2.3: Server crashes on Windows using Eclipse/Junit

2007-10-23 Thread Dave Page
Rainer Bauer wrote: >> ...yep, under XP I'm using about 3.1KB of the service heap per >> connection, which tears through it quite a bit faster. Now to figure >> out exactly where it's coming from... > > I can confirm this here (WinXP SP2). It's coming from direct dependencies on user32.dll (from

Re: [GENERAL] autovacuum and locks

2007-10-23 Thread Alvaro Herrera
Dietmar Maurer wrote: > > > > > > Why cant postgres get the RowExclusiveLock in transaction 3369000? > > > > Probably because the ExclusiveLock'ers are waiting in front > > of RowExclusiveLock. Locks are granted in order. > > > > It would help if you didn't mangle the pg_locks output so badly

Re: [GENERAL] Determine query run-time from pg_* tables

2007-10-23 Thread Erik Jones
On Oct 23, 2007, at 8:43 AM, Alvaro Herrera wrote: Ow Mun Heng wrote: Hi, Is there a method to obtain the query's runtime from any of the pg_* tables? No. You can use log_durations and log_statement for that. We don't store that info in tables. Right now, I'm only seeing the backend_star

Re: [GENERAL] Bitmap Heap scan 8.1/8.2

2007-10-23 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > Martin Marques escribió: >>> seq_page_cost = 5.0 # measured on an arbitrary scale > What people generally do around here is mess with random_page_cost, and > leave seq_page_cost alone. It's also worth pointing out that having seq_pa

Re: [GENERAL] How to speedup intarray aggregate function?

2007-10-23 Thread Alvaro Herrera
Dmitry Koterov escribió: > I have written in C all needed contrib functions: intarray.bidx() (binary > search in sorted list) and intagg.int_agg_append_state (bufferized appending > of one array to another without linear memory reallocation). The speed now > is great: in one case with intersection

Re: [GENERAL] autovacuum and locks

2007-10-23 Thread Alvaro Herrera
Dietmar Maurer wrote: > The pg_locks table shows the following: > > > SELECT pg_class.relname AS table, transaction, pid, mode, granted FROM > pg_locks, pg_class, pg_database WHERE pg_locks.relation = pg_class.oid > AND pg_locks.database = pg_database.oid; > > pg_class33

Re: [GENERAL] Determine query run-time from pg_* tables

2007-10-23 Thread Alvaro Herrera
Ow Mun Heng wrote: > Hi, > > Is there a method to obtain the query's runtime from any of the pg_* > tables? No. You can use log_durations and log_statement for that. We don't store that info in tables. > Right now, I'm only seeing the backend_start_time (from > pg_stat_activity) (and I'm also

Re: [GENERAL] Bitmap Heap scan 8.1/8.2

2007-10-23 Thread Alvaro Herrera
Martin Marques escribió: > Martin Marques escribió: >> Pavel Stehule wrote: >>> >>> try >>> >>> set work_mem to '8MB'; >>> and >>> explain analyze select .. >> These things didn't help. What changed the plan completely was this: >> seq_page_cost = 5.0 # measured on an arbitrary

[GENERAL] Determine query run-time from pg_* tables

2007-10-23 Thread Ow Mun Heng
Hi, Is there a method to obtain the query's runtime from any of the pg_* tables? Right now, I'm only seeing the backend_start_time (from pg_stat_activity) (and I'm also not sure how to interpret this. ---(end of broadcast)--- TIP 1: if posting/rea

Re: [GENERAL] unicode searches failing that use % and LIKE operators

2007-10-23 Thread Benjamin Weaver
Tom, Greg, Please accept my considerable apologies. The fault was my own program that loaded metadata into the text column, metadatafulltext. My reason (not a sufficient excuse!) for overlooking the problem is that the Unicode is invisible in psql windows, therefore it was not a simple matter

Re: [GENERAL] Reliability of WAL replication

2007-10-23 Thread Simon Riggs
On Tue, 2007-10-23 at 13:58 +0200, Marc Schablewski wrote: > We had some corrupted data files in the past (missing clog, see > http://archives.postgresql.org/pgsql-bugs/2007-07/msg00124.php) and are > thinking about setting up a warm standby system using WAL replication. > > Would an error like th

Re: [GENERAL] Bitmap Heap scan 8.1/8.2

2007-10-23 Thread Pavel Stehule
2007/10/23, Martin Marques <[EMAIL PROTECTED]>: > Martin Marques escribió: > > Pavel Stehule wrote: > >> > >> try > >> > >> set work_mem to '8MB'; > >> and > >> explain analyze select .. > > > > These things didn't help. What changed the plan completely was this: > > > > seq_page_cost = 5.0

Re: [GENERAL] SQL spec/implementation question: UPDATE

2007-10-23 Thread Nis Jørgensen
Albe Laurenz skrev: > Tom Lane wrote: >>> I don't have handy a spec guide. Does this mean that MySQL >>> is indeed showing incorrect behavior? >> I think this is really outside the spec. > [...] >> There is not anything I can see addressing whether an >> "update" should or should not be considere

Re: [GENERAL] Reliability of WAL replication

2007-10-23 Thread Csaba Nagy
Marc, On Tue, 2007-10-23 at 13:58 +0200, Marc Schablewski wrote: > We had some corrupted data files in the past (missing clog, see > http://archives.postgresql.org/pgsql-bugs/2007-07/msg00124.php) and are > thinking about setting up a warm standby system using WAL replication. > > Would an error

Re: [GENERAL] 8.2.3: Server crashes on Windows using Eclipse/Junit

2007-10-23 Thread Rainer Bauer
"Trevor Talbot" wrote: >I wrote: > >[ desktop heap usage ] > >> It could be that there's a significant difference between XP and 2003 >> in how that's handled though. I do have an XP SP2 machine here with >> 512MB RAM, and I'll try tests on it as soon as I can free up what it's >> currently occup

Re: [GENERAL] Bitmap Heap scan 8.1/8.2

2007-10-23 Thread Martin Marques
Martin Marques escribió: Pavel Stehule wrote: try set work_mem to '8MB'; and explain analyze select .. These things didn't help. What changed the plan completely was this: seq_page_cost = 5.0 # measured on an arbitrary scale cpu_tuple_cost = 0.05 # same

[GENERAL] Reliability of WAL replication

2007-10-23 Thread Marc Schablewski
We had some corrupted data files in the past (missing clog, see http://archives.postgresql.org/pgsql-bugs/2007-07/msg00124.php) and are thinking about setting up a warm standby system using WAL replication. Would an error like the one we had appear in WAL and would it be replicated too? Or is ther

Re: [GENERAL] pg_cancel_backend() does not work with buzz queries

2007-10-23 Thread Sergey Konoplev
2007/10/23, Martijn van Oosterhout <[EMAIL PROTECTED]>: > On Tue, Oct 23, 2007 at 09:56:26AM +0400, Sergey Konoplev wrote: > > I took a look at TCP state with netstat: > > > > pgdb:/base/PG-Data # netstat -pna |grep 8590 > > tcp1 0 127.0.0.1:5432 127.0.0.1:35442 > > CLOSE_WAIT

Re: [GENERAL] unicode searches failing that use % and LIKE operators

2007-10-23 Thread Benjamin Weaver
Thanks, Tom and Greg, for all your help. I agree that Redhat 9 is a bit creaky and that we here should upgrade. In the meantime I will put together a tiny test case that will reproduce the problem (at least on my platform). Ben In message <[EMAIL PROTECTED]> Tom Lane <[EMAIL PROTECTED]> writ

Re: [GENERAL] How to transfer from place to plase without backup/restore

2007-10-23 Thread Shane Ambler
Hristo Filipov wrote: Is it possible to transfer database from one place to another without making backup from the source and restore at the target? I mean I want to copy the files as they are at the source to the target? What else I must do, so I can attach them to the target PostgreSQL datab

[GENERAL] How to transfer from place to plase without backup/restore

2007-10-23 Thread Hristo Filipov
Is it possible to transfer database from one place to another without making backup from the source and restore at the target? I mean I want to copy the files as they are at the source to the target? What else I must do, so I can attach them to the target PostgreSQL database? Also I'm creating s

[GENERAL] How to transfer from place to plase without backup/restore

2007-10-23 Thread Hristo Filipov
Is it possible to transfer database from one place to another without making backup from the source and restore at the target? I mean I want to copy the files as they are at the source to the target? What else I must do, so I can attach them to the target PostgreSQL database? Also I'm creating s

[GENERAL] alter database tablespace

2007-10-23 Thread Rafael Martinez
Hello I am wondering if 8.4 is going to implement this: ALTER DATABASE name SET TABLESPACE new_tablespace I cannot find information in the todo list about the priority or release that would implement this feature. regards -- Rafael Martinez, <[EMAIL PROTECTED]> Center for Information Techno

Re: [GENERAL] pg_cancel_backend() does not work with buzz queries

2007-10-23 Thread Martijn van Oosterhout
On Tue, Oct 23, 2007 at 09:56:26AM +0400, Sergey Konoplev wrote: > I took a look at TCP state with netstat: > > pgdb:/base/PG-Data # netstat -pna |grep 8590 > tcp1 0 127.0.0.1:5432 127.0.0.1:35442 > CLOSE_WAIT 8590/postgres: kono CLOSE_WAIT means that the client (in this ca