[GENERAL] dump Functions

2006-04-28 Thread Dany De Bontridder
Hello, I would like to dump all my functions and only the functions from a database, how can I do that ?? So far, I can only get it with pg_dump -s dossier1|awk '/CREATE FUNCTION/,/LANGUAGE/ { print $0;}' Regards, D. ---(end of broadcast)--- T

Re: [GENERAL] Is it possible to summarize uniqe values from an indexed

2006-04-28 Thread Mike Leahy
Martijn, This works rather well - especially in my case, where I have thousands of rows in my tables with only a handful of unique values in the year column.  I'm not sure if I can get it to work in pl/pgsql as a function (I'll give it a shot), but it'll be no problem for me to add a routine i

Re: [GENERAL] How to define + operator for strings

2006-04-28 Thread Geoffrey
Martijn van Oosterhout wrote: Does it not support the SQL standard way of string concatination? You should be planning a transition because text+text will cause problems down the line... Sounds to me like a job for sed, awk, perl, tr choose your conversion tool. Make the code right, don'

Re: [GENERAL] Use of ISpell dictionaries with tsearch2 - what is the point?

2006-04-28 Thread Don Walker
I realized shortly after I sent this email that I could use a synonym dictionary to solve problem #2. To construct it myself I'd have to determine the common misspellings and create synonyms for them. So I have two more questions: 2.1 Are there any canned synonym dictionaries available the deal wi

Re: [GENERAL] Autovacuum Logging

2006-04-28 Thread Bruce Momjian
Robert Treat wrote: > On Thursday 27 April 2006 11:59, Bruce Momjian wrote: > > Well, one problem now is that everytime pg_autovacuum opens a database, > > a message is placed in the logs: > > > > LOG: autovacuum: processing database "test" > > LOG: autovacuum: processing database "test"

Re: [GENERAL] How to define + operator for strings

2006-04-28 Thread Martijn van Oosterhout
On Fri, Apr 28, 2006 at 07:35:20PM +0300, Andrus wrote: > > text + text will tend to capture ambiguous cases, > > and thus possibly break queries that used to work (date + integer is a > > case that comes to mind as being at risk). > > How to add + operator for strings so that date+integer expr

Re: [GENERAL] Autovacuum Logging

2006-04-28 Thread Jim Buttafuoco
I would like to bring up again that it would be nice if vacuum/analyze recorded the last action and stats in a table (pg_vacuum) within each database. Then dba's can make better decisions how vacuum/analyze is working as well as tuning the fsm guc's. This should be a real easy additions to th

[GENERAL] Use of ISpell dictionaries with tsearch2 - what is the point?

2006-04-28 Thread Don Walker
I'm new to using tsearch2 and am trying to understand why I would want to use an ISpell dictionary before the stemming dictionary. I'd originally hoped that ISpell would suggest corrections for misspelled words as the documents that I will be indexing will contain a lot of spelling mistakes. From w

Re: [GENERAL] Autovacuum Logging

2006-04-28 Thread Larry Rosenman
Robert Treat wrote: > On Thursday 27 April 2006 11:59, Bruce Momjian wrote: >> Well, one problem now is that everytime pg_autovacuum opens a >> database, a message is placed in the logs: >> >> LOG: autovacuum: processing database "test" >> LOG: autovacuum: processing database "test" >>

Re: [GENERAL] Autovacuum Logging

2006-04-28 Thread Robert Treat
On Thursday 27 April 2006 11:59, Bruce Momjian wrote: > Well, one problem now is that everytime pg_autovacuum opens a database, > a message is placed in the logs: > > LOG: autovacuum: processing database "test" > LOG: autovacuum: processing database "test" > LOG: autovacuum: pr

Re: [GENERAL] Alternative for vacuuming queue-like tables

2006-04-28 Thread Robert Treat
On Friday 28 April 2006 12:20, Csaba Nagy wrote: > > There is, I believe, a problem there; there is a scenario where data > > can get "dropped out from under" those old connections. > > > > This has been added to the TODO... > > > > http://www.postgresql.org/docs/faqs.TODO.html > > > > * Make CLUST

Re: [GENERAL] query that needs two nested queries, is this the best

2006-04-28 Thread Mark Harrison
Richard Huxton wrote: SELECT id FROM p4_versions WHERE (versionof, version) IN (SELECT id,headver FROM p4_files WHERE ...) Ahh, just what I was looking for... Thanks All! Mark ---(end of broadcast)--- TIP 4: Have you searched our list archives

Re: [GENERAL] Installing PostgreSQL on Win 2003 R2 64-bit

2006-04-28 Thread Merlin Moncure
On 4/28/06, Tom Lane <[EMAIL PROTECTED]> wrote: "Magnus Hagander" <[EMAIL PROTECTED]> writes: >> On 4/27/06, Aly Dharshi <[EMAIL PROTECTED]> wrote: >> Either of these approaches could work, but expect to be >> hacking around wierd problems. There is decent chance pgsql >> will be officially supp

Re: [GENERAL] Checking for Foreign Keys constraining a record?

2006-04-28 Thread David Fetter
On Thu, Apr 27, 2006 at 04:38:35PM -0700, Benjamin Smith wrote: > I have a customer table (very important) and have numerous fields in other > tables FK to the serial id of the customer table. > > There's an option to delete a customer record, but it has to fail if any > records are linked to i

Re: [GENERAL] A few things on intervals

2006-04-28 Thread Bruno Wolff III
On Fri, Apr 28, 2006 at 13:52:09 +0200, Alban Hertroys <[EMAIL PROTECTED]> wrote: > I realize that this isn't possible for intervals like '1 year 3 months', > but we only use relatively simple intervals like '3 months', '6 weeks' > and '100 hours'. > > Is there some easy way to query such inte

Re: [GENERAL] How to define + operator for strings

2006-04-28 Thread Andrus
> text + text will tend to capture ambiguous cases, > and thus possibly break queries that used to work (date + integer is a > case that comes to mind as being at risk). How to add + operator for strings so that date+integer expression is not broken ? > Refusing to deal with databases that ca

Re: [GENERAL] Alternative for vacuuming queue-like tables

2006-04-28 Thread Csaba Nagy
> There is, I believe, a problem there; there is a scenario where data > can get "dropped out from under" those old connections. > > This has been added to the TODO... > > http://www.postgresql.org/docs/faqs.TODO.html > > * Make CLUSTER preserve recently-dead tuples per MVCC requirements OK, I

Re: [GENERAL] Alternative for vacuuming queue-like tables

2006-04-28 Thread Chris Browne
[EMAIL PROTECTED] (Csaba Nagy) writes: > On Fri, 2006-04-28 at 15:20, kmh496 wrote: >> 2006-04-28 (금), 14:40 +0200, Csaba Nagy 쓰시길: >> > I placed a cron job to >> > cluster the queue table on it's PK index. >> what does that mean? > > Means execute: > > CLUSTER pk_queue_table ON queue_table

Re: [GENERAL] Postmaster process on port 10000

2006-04-28 Thread Tom Lane
Volker =?ISO-8859-1?Q?A=DFmann?= <[EMAIL PROTECTED]> writes: > We have a problem with our postmaster process, which normaly runs on port > 5432. From time to time it spawns another process which listens on port > 1 - which also happens to be the port for our own server. I don't find > any confi

Re: [GENERAL] Alternative for vacuuming queue-like tables

2006-04-28 Thread Csaba Nagy
> > actually does work, I can confirm that. Is it violating MVCC maybe ? > > Yes :-(. I think you can get away with it if all your transactions that [snip] Well, I actually don't want to get away this time :-) This table is only processed by the queue manager and that uses very short transactio

Re: [GENERAL] Alternative for vacuuming queue-like tables

2006-04-28 Thread Tom Lane
Csaba Nagy <[EMAIL PROTECTED]> writes: > I'm not sure how this operation can work in the presence of other long > running transactions which did not touch the queue table yet, but it > actually does work, I can confirm that. Is it violating MVCC maybe ? Yes :-(. I think you can get away with it i

Re: [GENERAL] How to define + operator for strings

2006-04-28 Thread Tom Lane
"A. Kretschmer" <[EMAIL PROTECTED]> writes: > am 28.04.2006, um 12:59:25 +0300 mailte Andrus folgendes: >> How to define + operator as alias of || operator for strings > create function _string_plus(text, text) returns text as $$ > begin > return $1 || $2; > end; > $$ language plpgsql; >

[GENERAL] Postmaster process on port 10000

2006-04-28 Thread Volker Aßmann
Hi! We have a problem with our postmaster process, which normaly runs on port 5432. From time to time it spawns another process which listens on port 1 - which also happens to be the port for our own server. I don't find any configuration option which could cause this behaviour. Does anyone h

Re: [GENERAL] Alternative for vacuuming queue-like tables

2006-04-28 Thread Vivek Khera
On Apr 28, 2006, at 9:32 AM, Csaba Nagy wrote: I'm not sure how this operation can work in the presence of other long running transactions which did not touch the queue table yet, but it actually does work, I can confirm that. Is it violating MVCC maybe ? It sounds like it does potentially vi

Re: [GENERAL] Installing PostgreSQL on Win 2003 R2 64-bit

2006-04-28 Thread Tom Lane
"Magnus Hagander" <[EMAIL PROTECTED]> writes: >> On 4/27/06, Aly Dharshi <[EMAIL PROTECTED]> wrote: >> Either of these approaches could work, but expect to be >> hacking around wierd problems. There is decent chance pgsql >> will be officially supported on windows as of 8.2, scheduled >> for re

Re: [GENERAL] Init script for 8.1 compiled on Debian Stable

2006-04-28 Thread Martijn van Oosterhout
On Fri, Apr 28, 2006 at 10:53:25AM -0400, [EMAIL PROTECTED] wrote: > My question is, I got a copy of an 'init.d' script from another 8.1 on > Debian install (from apt-get) and tried it on my system which, > obviously, failed. Does any know of/have/are will to share an 'init.d' > script for a stoc

Re: [GENERAL] Init script for 8.1 compiled on Debian Stable

2006-04-28 Thread Jim Buttafuoco
I use the one in /contrib/start-scripts from the src tarball. -- Original Message --- From: [EMAIL PROTECTED] To: pgsql-general@postgresql.org Sent: Fri, 28 Apr 2006 10:53:25 -0400 (EDT) Subject: [GENERAL] Init script for 8.1 compiled on Debian Stable > Hi all, > > For the fir

Re: [GENERAL] Is it possible to summarize uniqe values from an indexed column?

2006-04-28 Thread Martijn van Oosterhout
On Fri, Apr 28, 2006 at 08:35:08AM -0400, Mike Leahy wrote: > Hello list, > > Following from a question I had yesterday, I'm wondering if there is > some way to summarize the unique values of an indexed column in > PostgreSQL without having the query scan the whole table. For my > current work, I

[GENERAL] Init script for 8.1 compiled on Debian Stable

2006-04-28 Thread linux
Hi all, For the first time, I decided to compile and manually install PostgreSQL 8.1. I did it on my Debian Stable machine because I didn't want to add the testing or unstable repositories. Everything works fine with PostgreSQL 8.1! My question is, I got a copy of an 'init.d' script from anot

Re: [GENERAL] Alternative for vacuuming queue-like tables

2006-04-28 Thread Csaba Nagy
On Fri, 2006-04-28 at 15:20, kmh496 wrote: > 2006-04-28 (금), 14:40 +0200, Csaba Nagy 쓰시길: > > I placed a cron job to > > cluster the queue table on it's PK index. > what does that mean? Means execute: CLUSTER pk_queue_table ON queue_table; See http://www.postgresql.org/docs/8.1/static/sql-cluste

Re: [GENERAL] Installing PostgreSQL on Win 2003 R2 64-bit

2006-04-28 Thread Bruce Momjian
Magnus Hagander wrote: > > On 4/27/06, Aly Dharshi <[EMAIL PROTECTED]> wrote: > > > Yes, if you search the archives there was something on > > this. Maybe it > > > was around 32-bit, but nonetheless, take a search through. > > > > There is a patch in the queue written by Magnus Hagander > > rig

Re: [GENERAL] Alternative for vacuuming queue-like tables

2006-04-28 Thread kmh496
2006-04-28 (금), 14:40 +0200, Csaba Nagy 쓰시길: > I placed a cron job to > cluster the queue table on it's PK index. what does that mean? -- my site http://www.myowndictionary.com";>myowndictionary was made to help students of many languages learn them faster. ---(end of

[GENERAL] Alternative for vacuuming queue-like tables

2006-04-28 Thread Csaba Nagy
Hi all, Short background: postgres does not support very well queue type tables in an environment where these queue tables are small in size but heavily inserted/updated/deleted, while there are activities in the system which cause long running transactions. The reason is that the queue table cann

[GENERAL] Is it possible to summarize uniqe values from an indexed column?

2006-04-28 Thread Mike Leahy
Hello list, Following from a question I had yesterday, I'm wondering if there is some way to summarize the unique values of an indexed column in PostgreSQL without having the query scan the whole table. For my current work, I have many large tables, all of which have an indexed column for the yea

[GENERAL] A few things on intervals

2006-04-28 Thread Alban Hertroys
I am trying to get infinity in an interval type on PostgreSQL 7.4.7. I can't seem to get this done, even though there's allegedly an isfinite(interval) function. For now we use NULL instead, but what would have worked? Next to that I noticed: select age('infinity'::timestamp);

Re: [GENERAL] How to define + operator for strings

2006-04-28 Thread A. Kretschmer
am 28.04.2006, um 12:59:25 +0300 mailte Andrus folgendes: > I want to create portable code which runs in other dbms without > modification. > > Unfortunately this other dbms uses + for string concatenation and has no way > to define operators. > > How to define + operator as alias of || operat

[GENERAL] How to define + operator for strings

2006-04-28 Thread Andrus
I want to create portable code which runs in other dbms without modification. Unfortunately this other dbms uses + for string concatenation and has no way to define operators. How to define + operator as alias of || operator for strings so I can use SELECT firstname+ ' '+ lastname ... in Pos

Re: [GENERAL] For vim users: Syntax highlighting for PostgreSQL

2006-04-28 Thread Terry Lee Tucker
On Thursday 27 April 2006 07:43 pm, Devrim GUNDUZ <[EMAIL PROTECTED]> thus communicated: --> Hi, --> --> I just wrote a pgsql.vim file for vim users. It helps you to colorize --> the file which contains PostgreSQL SQL keywords: --> --> http://www.gunduz.org/postgresql/pgsql.vim --> --> In orde

Re: [GENERAL] Having problems with a 25 million row table on 8.1.3

2006-04-28 Thread hubert depesz lubaczewski
On 4/25/06, Tony Caduto <[EMAIL PROTECTED]> wrote: So far it has worked great, but today someone wanted to get all the taxcodes(there are lot's of dupes) from the table.others already suggested group by approach.i would like to also suggest use of triggers to maintain tax codes list in separate tab

Re: [GENERAL] Installing PostgreSQL on Win 2003 R2 64-bit

2006-04-28 Thread Magnus Hagander
> On 4/27/06, Aly Dharshi <[EMAIL PROTECTED]> wrote: > > Yes, if you search the archives there was something on > this. Maybe it > > was around 32-bit, but nonetheless, take a search through. > > There is a patch in the queue written by Magnus Hagander > right now which allows pg to build from