[GENERAL] (Never?) Kill Postmaster?

2007-10-24 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

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

2007-10-24 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 to use more

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

2007-10-24 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 then issue

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

2007-10-24 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

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

2007-10-24 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

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

2007-10-24 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.:

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

2007-10-24 Thread Thomas Kellerer
Craig Hawkes, 24.10.2007 05:14: - running as a service What happens in the unlikely event that they already have a version of Postgres installed? As far as I know you can happily install different versions in parallel. You just need to make sure the service name is unique (e.g. by

Re: [GENERAL] can't compile Pl/Java

2007-10-24 Thread Albe Laurenz
Roger Mason wrote: 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: [...] i686-pc-linux-gnu-gcc -c -O2 -march=pentium-m -pipe -Wall -Wmissing-prototypes

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

2007-10-24 Thread Albe Laurenz
Farhan Khan 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/local/pgsql/data LOG: database

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

2007-10-24 Thread Michael Harris
Hi, First you need to identify the correct postgresql process. Postgresql spawns an individual server process for each database connection. They look something like this: postgres 27296 7089 9 08:00 ?00:05:52 postgres: username databasename [local] idle If a query was running

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

2007-10-24 Thread Pavel Stehule
2007/10/24, Christian Schröder [EMAIL PROTECTED]: 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)? shared memory can

[GENERAL] deadlock detected, only selects (not select-for-update)

2007-10-24 Thread Gábor Farkas
hi, i got the following error-message: ERROR: deadlock detected DETAIL: Process 32618 waits for ShareLock on transaction 1137032034; blocked by process 16136. Process 16136 waits for ShareLock on transaction 1137045910; blocked by process 32618. (postgres 7.4 here) i checked the

[GENERAL] Selecting K random rows - efficiently!

2007-10-24 Thread cluster
It has been suggested [1] that a good way to select K random rows efficiently from a table is to 1) add a new column, random_number, to the table and initialize it with random() 2) perform the following query: SELECT * FROM mydata WHERE random_number = (SELECT

Re : [GENERAL] pg_dump auto login

2007-10-24 Thread Laurent ROCHE
Warren, make sure that the pgpass.conf contains the correct entries (server name, user name, password). If you are prompted for a password, it's because pg_dump could not find a matching entry to what is specified in your pg_dump command. You can make a test with pgAdmin and if it prompts your

Re: [GENERAL] Selecting K random rows - efficiently!

2007-10-24 Thread cluster
Another way to look at the problem is: How do I sample a subset of size K efficiently? A query like SAMPLE 1000 OF (SELECT * FROM mydata WHERE some condition) should return 1000 random rows from the select statement so that two consecutive evaluations of the query would only with very

Re: [GENERAL] deadlock detected, only selects (not select-for-update)

2007-10-24 Thread Gregory Stark
Gábor Farkas [EMAIL PROTECTED] writes: BEGIN; SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; now a lot of selects, but nothing complicated, all of the form of SELECT x FROM y WHERE a=b, with some simple joins, and SELECT DISTINCT and ORDER BY. END; can any of these commands cause the

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

2007-10-24 Thread Tom Lane
Michael Harris [EMAIL PROTECTED] writes: The tip is ''kill -9' the postmaster', which has two important differences to the scenario I just described: 1) kill -9 means the OS kills the process without allowing it to clean up after itself 2) The postmaster is the master postgresql backend

[GENERAL] Install plJava

2007-10-24 Thread João Paulo Zavanela
Hi there, I trying to install pljava, but I'm getting error in this command line: C:\Documents and Settings\Joao Paulojava -cp C:\\Program Files\\PostgreSQL\\8. 2\\share\\pljava\\deploy.jar;C:\\Program Files\\PostgreSQL\\8.2\\jdbc\\postgre sql-8.2-504.jdbc3.jar

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

2007-10-24 Thread Bill Moran
In response to 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, Tracing through the other

Re: [GENERAL] Selecting K random rows - efficiently!

2007-10-24 Thread Martijn van Oosterhout
On Wed, Oct 24, 2007 at 10:59:46AM +0200, cluster wrote: Another way to look at the problem is: How do I sample a subset of size K efficiently? A query like SAMPLE 1000 OF (SELECT * FROM mydata WHERE some condition) How important is true randomness? To get the best possible

[GENERAL] initdb: file /usr/local/share/postgresql/snowball_create.sql does not exist

2007-10-24 Thread rihad
Hi, After installing Postgresql 8.3 beta1 on a fresh FreeBSD 6.2 (port databases/postgresql83-server) initdb gives error: # /usr/local/etc/rc.d/postgresql initdb initdb: file /usr/local/share/postgresql/snowball_create.sql does not exist This means you have a corrupted installation or

[GENERAL] Concatenate two queries - how?

2007-10-24 Thread Stefan Schwarzer
Hi there, I have two queries, which I would like to bring together to form one result. The first query is a simple SELECT on a table of national statistics. SELECT COALESCE(c.name, ), year_start AS year, value FROM fish_catch AS d LEFT JOIN

Re: [GENERAL] initdb: file /usr/local/share/postgresql/snowball_create.sql does not exist

2007-10-24 Thread Alvaro Herrera
rihad wrote: Hi, After installing Postgresql 8.3 beta1 on a fresh FreeBSD 6.2 (port databases/postgresql83-server) initdb gives error: # /usr/local/etc/rc.d/postgresql initdb initdb: file /usr/local/share/postgresql/snowball_create.sql does not exist This means you have a corrupted

Re: [GENERAL] Concatenate two queries - how?

2007-10-24 Thread A. Kretschmer
am Wed, dem 24.10.2007, um 15:08:51 +0200 mailte Stefan Schwarzer folgendes: Now, I want to enable queries which display national as well as regional values. I could probably work with independent queries, but I think it would be cleaner and more efficient to get everything into a

Re: [GENERAL] Concatenate two queries - how?

2007-10-24 Thread Gauthier, Dave
Use union ??? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Stefan Schwarzer Sent: Wednesday, October 24, 2007 9:09 AM To: pgsql-general@postgresql.org Subject: [GENERAL] Concatenate two queries - how? Hi there, I have two queries, which I would like

Re: [GENERAL] Concatenate two queries - how?

2007-10-24 Thread Stanislav Raskin
I don't know whether I did understand you entirely, but you might want to take a look at the UNION clause: http://www.postgresql.org/docs/8.2/interactive/sql-select.html#SQL-UNION -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Stefan Schwarzer

[GENERAL] using libpq.lib in Microsoft C++ (managed)

2007-10-24 Thread luca . ciciriello
: In REGALO un GIOCO! Scegli GPBikes 3D,Bubble Boom, Rock City Empire Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=6732d=20071024

Re: [GENERAL] using libpq.lib in Microsoft C++ (managed)

2007-10-24 Thread Magnus Hagander
On Wed, Oct 24, 2007 at 03:06:03PM +0200, [EMAIL PROTECTED] wrote: Hi All. I've the necessity to call some functions of libpq.lib from my code. The problem is that my code is Managed C++ (as defined by Microsoft VisualStudio 2005). Managed C++ has a very special memory management and I don't

Re: [GENERAL] Extracting Index Creation Script

2007-10-24 Thread Paul Silveira
Hello, I answered my own question. :) I continued looking last night after I posted this and found a really easy way to get this info... select * from pg_indexes where tablename like 'YOURTABLENAME' This will give you the DDL to create your indexes. Regards, Paul Paul Silveira wrote:

[GENERAL] 8.3b1 in production?

2007-10-24 Thread rihad
Hi, Does anyone have an idea how risky it is to start using 8.3b1 in production, with the intention of upgrading to release (or newer beta) as soon as it becomes available? Risky compared to running a release, that is. Beta - release upgrades might be less tricky than 8.2 - 8.3. Thank you.

Re: [GENERAL] Selecting K random rows - efficiently!

2007-10-24 Thread cluster
How important is true randomness? The goal is an even distribution but currently I have not seen any way to produce any kind of random sampling efficiently. Notice the word efficiently. The naive way of taking a random sample of size K: (SELECT * FROM mydata ORDER BY random() LIMIT K) is

Re: [GENERAL] 8.3b1 in production?

2007-10-24 Thread Tom Lane
rihad [EMAIL PROTECTED] writes: Does anyone have an idea how risky it is to start using 8.3b1 in production, with the intention of upgrading to release (or newer beta) as soon as it becomes available? Risky compared to running a release, that is. Beta - release upgrades might be less tricky

[GENERAL] Constraints involving a system table

2007-10-24 Thread Andreas Neumann
Hello, I would like to create a constraint that involves the system table. CREATE TABLE metadata_tables ( schemaname text REFERENCES pg_namespace(nspname) ON DELETE CASCADE CONSTRAINT valid_schema CHECK (schemaname != 'public' AND schemaname != 'information_schema' AND schemaname NOT LIKE

[GENERAL] Automating Backup Restore

2007-10-24 Thread smiley2211
Hello all, Does someone have a script that backups a database from one server and restores it to another server??? I am NEW to Postgresql so I am starting from scratch... so, in essence - what I want to do is (I CURRENTLY DO THIS MANUALLY): Server1 (IS IT POSSIBLE TO DUMP DIRECTLY TO

Re: [GENERAL] 8.3b1 in production?

2007-10-24 Thread Jan de Visser
On Wednesday 24 October 2007 09:59:20 rihad wrote: Hi, Does anyone have an idea how risky it is to start using 8.3b1 in production, with the intention of upgrading to release (or newer beta) as soon as it becomes available? Risky compared to running a release, that is. Beta - release

Re: [GENERAL] Automating Backup Restore

2007-10-24 Thread Jan de Visser
On Wednesday 24 October 2007 10:39:23 smiley2211 wrote: Does someone have a script that backups a database from one server and restores it to another server???  I am NEW to Postgresql so I am starting from scratch... $ pg_dump -h server1 database | psql -h server2 jan --

[GENERAL] google

2007-10-24 Thread Ray Stell
where does a 500 lb gorilla sit? http://www.networkworld.com/news/2007/102307-mysql-to-get-injection-of.html?netht=102407dailynews1nladname=102407dailynews The companies are in close contact, Axmark said. The Google engineer in charge of its MySQL deployments spent several days at MySQL's

Re: [GENERAL] Automating Backup Restore

2007-10-24 Thread brian
Jan de Visser wrote: On Wednesday 24 October 2007 10:39:23 smiley2211 wrote: Does someone have a script that backups a database from one server and restores it to another server??? I am NEW to Postgresql so I am starting from scratch... $ pg_dump -h server1 database | psql -h server2 jan

[GENERAL] jdbc: ERROR transaction is read-only

2007-10-24 Thread ahnf
I am using the postgresql-8.2.506.jdbc4.jar file My jdbc connections are setReadOnly(false) When attempting an insert I get org.postgresql.util.PSQLException: ERROR: transaction is read-only ideas? ---(end of broadcast)--- TIP 3: Have you

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

2007-10-24 Thread Peter Manchev
IMHO, pl/perl;s global hash %_SHARED does not provide the same performance. With pl/perl with some data cached we will get getter performance, that is sure, but the body of the function will be evaluated anyway, so there will be some miliseconds lost. On the other hand, the body of a

Re: [GENERAL] google

2007-10-24 Thread Erik Jones
On Oct 24, 2007, at 8:44 AM, Ray Stell wrote: where does a 500 lb gorilla sit? http://www.networkworld.com/news/2007/102307-mysql-to-get-injection- of.html?netht=102407dailynews1nladname=102407dailynews The companies are in close contact, Axmark said. The Google engineer in charge of

Re: [GENERAL] Automating Backup Restor

2007-10-24 Thread Mikko Partio
On 10/24/07, smiley2211 [EMAIL PROTECTED] wrote: Hello all, Does someone have a script that backups a database from one server and restores it to another server??? I am NEW to Postgresql so I am starting from scratch... so, in essence - what I want to do is (I CURRENTLY DO THIS

Re: [GENERAL] 8.3b1 in production?

2007-10-24 Thread Gregory Stark
rihad [EMAIL PROTECTED] writes: Hi, Does anyone have an idea how risky it is to start using 8.3b1 in production, with the intention of upgrading to release (or newer beta) as soon as it becomes available? Risky compared to running a release, that is. Beta - release upgrades might be less

[GENERAL] PostgreSQL and AutoCad

2007-10-24 Thread Bob Pawley
Is there any way of converting text from an AutoCad (.dwg ot .dxf) file into a PostgreSQL Database?? Bob Pawley

[GENERAL] Solaris binaries for pgAdmin III

2007-10-24 Thread Roberts, Jon
I need to install the pgAgent daemon on Solaris but I don't see a binary for download except for earlier versions. How soon will v1.8 for Solaris be available in binary format? Thanks! Jon

[GENERAL] subversion support?

2007-10-24 Thread Roberts, Jon
Are there plans to support a plug-in to a version control system like subversion for DDL? We really need to version our functions we will be writing but currently, we have to go through some hoops to get the function code into subversion. Jon

Re: [GENERAL] Constraints involving a system table

2007-10-24 Thread Andreas Neumann
ok - so the trigger is the problem. I am aware that one should not mess around with system tables. is there a workaround? Maybe creating a view or a function? Thanks, Andreas Richard Huxton wrote: Andreas Neumann wrote: Hello, I would like to create a constraint that involves the system

Re: [GENERAL] subversion support?

2007-10-24 Thread brian
Roberts, Jon wrote: Are there plans to support a plug-in to a version control system like subversion for DDL? We really need to version our functions we will be writing but currently, we have to go through some hoops to get the function code into subversion. This is hoops? svn ci

Re: [GENERAL] subversion support?

2007-10-24 Thread Roberts, Jon
Yeah. I think having to save the function to disk and then leave pgAdmin to execute subversion commands is going through hoops. Also, pgAdmin should be integrated so that you are notified if the function in the database is different from the last committed version. A visual diff should be

Re: [GENERAL] Automating Backup Restore

2007-10-24 Thread smiley2211
THANKS ALL... -- View this message in context: http://www.nabble.com/Automating-Backup---Restore-tf4684052.html#a13392360 Sent from the PostgreSQL - general mailing list archive at Nabble.com. ---(end of broadcast)--- TIP 2: Don't 'kill -9' the

Re: [GENERAL] subversion support?

2007-10-24 Thread Joshua D. Drake
On Wed, 24 Oct 2007 14:11:24 -0500 Roberts, Jon [EMAIL PROTECTED] wrote: Yeah. I think having to save the function to disk and then leave pgAdmin to execute subversion commands is going through hoops. Also, pgAdmin should be integrated so that you are notified if the function in the

Re: [GENERAL] Concatenate two queries - how?

2007-10-24 Thread Harald Fuchs
In article [EMAIL PROTECTED], A. Kretschmer [EMAIL PROTECTED] writes: am Wed, dem 24.10.2007, um 15:08:51 +0200 mailte Stefan Schwarzer folgendes: Now, I want to enable queries which display national as well as regional values. I could probably work with independent queries, but I think

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

2007-10-24 Thread Craig Hawkes
Hi OK, Sorry but I did search, and did not find anything useful. Maybe putting forward a embedded solution as part of the question was the wrong option. If I could reword: Given that we have a large estiblished client base running a Delphi/Paradox solution, and that we would like to replace

Re: [GENERAL] FATAL: could not reattach to shared memory

2007-10-24 Thread Terry Yapt
Bruce Momjian escribió: This has been saved for the 8.4 release: http://momjian.postgresql.org/cgi-bin/pgpatches_hold Update: I have installed PostgreSQL 8.2.5 and move database from old to new server. This was 2 weeks ago. New Server is a Windows 2003 Server running other

[GENERAL] GRANT error

2007-10-24 Thread Erik Jones
So, I'm working with some grant/revoke scripts today and occasionally I see this while running tests: STATEMENT: GRANT select, insert, update, delete ON public.tablename TO app; ERROR: tuple concurrently updated What's going on? Do I actually need a lock on the table to ensure this

[GENERAL] Fragments in tsearch2 headline

2007-10-24 Thread Catalin Marinas
Hi, (I first posted it via google groups and realised that I have to be subscribed; now posting directly) I searched the list but couldn't find anyone raising the issue (or it might simply be my way of using the tool). I'd like to search through some text documents for words and generate

Re: [GENERAL] Install plJava

2007-10-24 Thread Guy Rouillier
João Paulo Zavanela wrote: The file pljava.dll exist in directory, why this error? Someone can help me? PL/Java has it's own mailing list here: http://gborg.postgresql.org/mailman/listinfo/pljava-dev I think it is still active, but I'm not sure. Sorry, I'm short on time. Search the

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

2007-10-24 Thread Andrej Ricnik-Bay
On 10/25/07, Craig Hawkes [EMAIL PROTECTED] wrote: There will really be two targets, replacing the existing single user solutions, and providing a larger solution with multi-user etc. There is however large base of similar code between these solutions, and it would be perferable if they could

[GENERAL] Migration questions for upcoming 8.3 release and fts

2007-10-24 Thread Chris Travers
Hi all; I know -hackers is the preferred place to discuss beta releases, but I suspect that this is a further-reaching wuestion among the general community than is typical so I am posting it here. I have been looking at the changes expected for 8.3 and have noticed that tsearch2 has been

Re: [GENERAL] Selecting K random rows - efficiently!

2007-10-24 Thread Paul Tillotson
cluster wrote: It has been suggested [1] that a good way to select K random rows efficiently from a table is to 1) add a new column, random_number, to the table and initialize it with random() 2) perform the following query: SELECT * FROM mydata WHERE random_number

Re: [GENERAL] Crosstab Problems

2007-10-24 Thread Joe Conway
Tom Lane wrote: Jorge Godoy [EMAIL PROTECTED] writes: Em Thursday 18 October 2007 16:37:59 Joe Conway escreveu: The row is pretty useless without a rowid in this context -- it seems like the best thing to do would be to skip those rows entirely. Of course you could argue I suppose that it

Re: [GENERAL] Selecting K random rows - efficiently!

2007-10-24 Thread Scott Marlowe
Here's how I would do it. This assumes a static table that doesn't change a lot. 1: find the row count n of the table. 2: randomly assign 1 through n to each row randomly. How to do this is a whole not post. 3: create a sequence. If you always need 10 or 100 random rows, set the increment to

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

2007-10-24 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10/24/07 15:04, Craig Hawkes wrote: Hi OK, Sorry but I did search, and did not find anything useful. Maybe putting forward a embedded solution as part of the question was the wrong option. If I could reword: Given that we have a large

Re: [GENERAL] Crosstab Problems

2007-10-24 Thread Tom Lane
Joe Conway [EMAIL PROTECTED] writes: Tom Lane wrote: 1. Treat NULL rowid as a category in its own right. This would conform with the behavior of GROUP BY and DISTINCT, for instance. In any case, the attached changes the behavior to #1 for both flavors of crosstab (the original