[GENERAL] SYSCONFDIR, initdb and postgresql.conf

2010-11-20 Thread KM
On an OpenBSD machine I just compiled and installed 9.0.1. The ./configure arguments included '--sysconfdir=/etc'. Running 'pg_config --sysconfdir' returns '/etc/postgresql'. The cluster is running and I can create a database and connect to it. However, initdb put the config files in the direct

Re: [GENERAL] newbie question - delete before insert

2010-11-20 Thread Sim Zacks
How do people implement insert or upate ( otherwise known as upsert ) behaviour in postgres i.e. insert a row if it's key does not exist in the database else update the existing row? I tried using an insert rule to delete any existing rows first then insert however this leads to infinitely r

[GENERAL] shared data for different applications

2010-11-20 Thread Kent Tong
Hi, Let's say that there is some data that should be logically shared by many applications in the company, such as some core information about its customers (name, address, contact info). In principle, such data should be stored in a DB for sharing. But then if a certain application needs to acc

[GENERAL] shared data for different applications

2010-11-20 Thread Kent Tong
Hi, Let's say that there is some data that should be logically shared by many applications in the company, such as some core information about its customers (name, address, contact info). In principle, such data should be stored in a DB for sharing. But then if a certain application needs to acc

[GENERAL] Cancel a query.

2010-11-20 Thread Rob Brown-Bayliss
Hi I have some code using psycopg in python. Connecting in async mode. I am trying to catch time outs etc, basically after a set amount of time I am assuming something has failed. I then want to use "select pg_cancel_backend(15209);" to cancel the query. But I can't unless I am connected as th

Fwd: [GENERAL] The first dedicated PostgreSQL forum

2010-11-20 Thread Elliot Chance
Apple Mail has not been copying the mailing list, so excuse the reposts if you got one. Begin forwarded message: > From: Elliot Chance > Date: 14 November 2010 12:30:19 PM AEDT > To: Tom Lane > Subject: Re: [GENERAL] The first dedicated PostgreSQL forum > > > On 14/11/2010, at 6:24 AM, Tom L

Re: [GENERAL] [pgsql-www] Forums at postgresql.com.au

2010-11-20 Thread Michael Glaesemann
On Nov 20, 2010, at 8:22 , Elliot Chance wrote: > One very annoying thing about Apple Mail with these lists is that when I hit > reply if I don't change the To address to the mailing list or manually add > the Cc then it doesn't even get sent to the mailing list. Use Reply to All: Cmd-Shift-R.

Re: Fwd: [GENERAL] Postgres forums ... take 2

2010-11-20 Thread Bruce Momjian
Elliot Chance wrote: > > Also, if someone registers on the forum, do they get a major domo > > registration email? And if so, would this be set to receive no emails upon > > registration? I'm not clear as to how this step would work because, at the > > moment, mailing list subscribers have to

Re: [GENERAL] Fwd: [pgsql-www] Forums at postgresql.com.au

2010-11-20 Thread Elliot Chance
On 21/11/2010, at 2:41 AM, Tom Lane wrote: > Elliot Chance writes: >> Then I can create a catch-all so that when an email is sent to >> forums-chan...@postgresql.com.au it finds the user "chancey" gets the real >> address and sends it on. If there were a way we could register a range for >> m

Re: [GENERAL] [pgsql-www] Forums at postgresql.com.au

2010-11-20 Thread Trevor Talbot
On Sat, Nov 20, 2010 at 05:46, Elliot Chance wrote: > On 21/11/2010, at 12:32 AM, Magnus Hagander wrote: >> On Sat, Nov 20, 2010 at 14:22, Elliot Chance wrote: >> Use "Reply To All" when you want to send to the list. It's what >> everybody else has been doing for ages :-) If you want to read u

Re: [GENERAL] Comparing first 3 numbers of a IPv4 address?

2010-11-20 Thread Dmitriy Igrishin
Hey Tom, Thanks for you solution! 2010/11/20 Tom Lane > Alexander Farber writes: > > 1) if I'd like to compare just the first 3 numbers of > > the IP address instead of the 4, how can I do it? > > regression=# select network(set_masklen('123.45.67.42'::inet, 24)) = > regression-# network(set_

Re: [GENERAL] Survey on backing up unlogged tables: help us with PostgreSQL development!

2010-11-20 Thread Josh Berkus
AFAIK we don't truncate the log file created by the log_filename GUC on every unclean crash and every clean shutdown. That's not a remotely relevant analogy. A log file is not a database table. If we allow a database table to become corrupted due to being unsynched at the time of shutdown,

Re: [GENERAL] Comparing first 3 numbers of a IPv4 address?

2010-11-20 Thread Alexander Farber
Thank you. Or maybe also? (author_ip & '255.255.255.0'::inet) = (_author_ip & '255.255.255.0'::inet) On Sat, Nov 20, 2010 at 4:47 PM, Tom Lane wrote: > Alexander Farber writes: >> 1) if I'd like to compare just the first 3 numbers of >> the IP address instead of the 4, how can I do it? > > reg

Re: [GENERAL] [pgsql-www] Forums at postgresql.com.au

2010-11-20 Thread Bruce Momjian
Magnus Hagander wrote: > On Sat, Nov 20, 2010 at 14:46, Elliot Chance wrote: > >>> for...@postgresql.com.au is pointed to a black hole so that email > >>> disappears but the mailing list gets another copy. When the mailing list > >>> gets its copy it sends a copy to the forum (because the forum

Re: [GENERAL] Postgres forums ... take 2

2010-11-20 Thread Bruce Momjian
Stephen Cook wrote: > On 11/16/2010 10:51 AM, Magnus Hagander wrote: > > What I'm more interested in is still a word from the people who would > > actually *use* a forum on how this would be better than sites like > > Nabble and Gmane. > > I'm one of those. I'm subscribed to these mailing lists si

Re: [GENERAL] Comparing first 3 numbers of a IPv4 address?

2010-11-20 Thread Tom Lane
Alexander Farber writes: > 1) if I'd like to compare just the first 3 numbers of > the IP address instead of the 4, how can I do it? regression=# select network(set_masklen('123.45.67.42'::inet, 24)) = regression-# network(set_masklen('123.45.67.56'::inet, 24)); ?column? -- t (1 row)

Re: [GENERAL] Fwd: [pgsql-www] Forums at postgresql.com.au

2010-11-20 Thread Tom Lane
Elliot Chance writes: > Then I can create a catch-all so that when an email is sent to > forums-chan...@postgresql.com.au it finds the user "chancey" gets the real > address and sends it on. If there were a way we could register a range for > mj2 like accept all emails from forum...@posgresql.c

Re: [GENERAL] [pgsql-www] Forums at postgresql.com.au

2010-11-20 Thread Magnus Hagander
On Sat, Nov 20, 2010 at 14:46, Elliot Chance wrote: >>> for...@postgresql.com.au is pointed to a black hole so that email >>> disappears but the mailing list gets another copy. When the mailing list >>> gets its copy it sends a copy to the forum (because the forum is just like >>> a subscribed

Re: [GENERAL] Comparing first 3 numbers of a IPv4 address?

2010-11-20 Thread Dmitriy Igrishin
I will be glad to see the best solution, so if you find it please share. :-) But you want to compare IP addresses by 3 first parts. I don't see any function or operator at SQL level which allow to do it without converting to text. Probably, you can do it by manipulating a binary form (from libpq).

Re: [GENERAL] where is pg_stat_activity (and others) in the documentation?

2010-11-20 Thread Scott Mead
On Mon, Nov 15, 2010 at 10:03 AM, Vick Khera wrote: > On Mon, Nov 15, 2010 at 5:15 AM, Willy-Bas Loos > wrote: > > I was looking for what exactly "waiting" means in pg_stat_activity. > You can find out exactly what you're waiting for by correlating this to the pg_locks table. Grab the 'proc

Re: [GENERAL] Comparing first 3 numbers of a IPv4 address?

2010-11-20 Thread Alexander Farber
I think inet is a number internally, there is probably a more effective way... On 11/20/10, Dmitriy Igrishin wrote: > You can. host() just extract IP address from a value of inet > type as text, string_to_array() converts this text to text[], and > it makes it possible to compare with another tex

Re: [GENERAL] Comparing first 3 numbers of a IPv4 address?

2010-11-20 Thread Dmitriy Igrishin
You can. host() just extract IP address from a value of inet type as text, string_to_array() converts this text to text[], and it makes it possible to compare with another text[]... I see no problem here. It works just fine. But probably there is another (better) solution... 2010/11/20 Alexander F

Re: [GENERAL] Comparing first 3 numbers of a IPv4 address?

2010-11-20 Thread Alexander Farber
I'm actually hoping to use inet (or cidr?) instead of strings... On 11/20/10, Dmitriy Igrishin wrote: > Hey Alexander, > > 2010/11/20 Alexander Farber > >> Hello, >> >> I'm trying to program a PHP-script, where users >> can rate the "goodness" of the other players: >> >>create table pr

Re: [GENERAL] Comparing first 3 numbers of a IPv4 address?

2010-11-20 Thread Dmitriy Igrishin
Hey Alexander, 2010/11/20 Alexander Farber > Hello, > > I'm trying to program a PHP-script, where users > can rate the "goodness" of the other players: > >create table pref_rep ( >id varchar(32) references pref_users(id) check (id <> > author), >author var

Re: [GENERAL] [pgsql-www] Forums at postgresql.com.au

2010-11-20 Thread Elliot Chance
Using the reply to all, thanks. On 21/11/2010, at 12:32 AM, Magnus Hagander wrote: > On Sat, Nov 20, 2010 at 14:22, Elliot Chance wrote: >> >> On 20/11/2010, at 11:52 PM, Magnus Hagander wrote: >> >>> On Sat, Nov 20, 2010 at 12:26, Elliot Chance wrote: On 20/11/2010, at 9:52 PM, Ma

Re: [GENERAL] [pgsql-www] Forums at postgresql.com.au

2010-11-20 Thread Magnus Hagander
On Sat, Nov 20, 2010 at 14:22, Elliot Chance wrote: > > On 20/11/2010, at 11:52 PM, Magnus Hagander wrote: > >> On Sat, Nov 20, 2010 at 12:26, Elliot Chance wrote: >>> >>> On 20/11/2010, at 9:52 PM, Magnus Hagander wrote: >>> On Sat, Nov 20, 2010 at 02:57, Elliot Chance wrote: > >

[GENERAL] Comparing first 3 numbers of a IPv4 address?

2010-11-20 Thread Alexander Farber
Hello, I'm trying to program a PHP-script, where users can rate the "goodness" of the other players: create table pref_rep ( id varchar(32) references pref_users(id) check (id <> author), author varchar(32) references pref_users(id), author_

Fwd: [GENERAL] Postgres forums ... take 2

2010-11-20 Thread Elliot Chance
Apple Mail has not been copying the mailing list, so excuse the reposts if you got one. Begin forwarded message: > From: Elliot Chance > Date: 16 November 2010 4:57:27 PM AEDT > To: Craig Ringer > Subject: Re: [GENERAL] Postgres forums ... take 2 > > On 16/11/2010, at 2:01 PM, Craig Ringer wr

Fwd: [GENERAL] Postgres forums ... take 2

2010-11-20 Thread Elliot Chance
Apple Mail has not been copying the mailing list, so excuse the reposts if you got one. Begin forwarded message: > From: Elliot Chance > Date: 15 November 2010 9:02:43 PM AEDT > To: Thom Brown > Subject: Re: [GENERAL] Postgres forums ... take 2 > > On 15/11/2010, at 8:37 PM, Thom Brown wrote:

Fwd: [GENERAL] The first dedicated PostgreSQL forum

2010-11-20 Thread Elliot Chance
Apple Mail has not been copying the mailing list, so excuse the reposts if you got one. Begin forwarded message: > From: Elliot Chance > Date: 19 November 2010 9:18:18 AM AEDT > To: Daniel Verite > Subject: Re: [GENERAL] The first dedicated PostgreSQL forum > > Is nobody reading the other "Po

[GENERAL] Fwd: [pgsql-www] Forums at postgresql.com.au

2010-11-20 Thread Elliot Chance
Begin forwarded message: > From: Magnus Hagander > Date: 20 November 2010 3:58:41 AM AEDT > To: Alvaro Herrera > Cc: Dave Page , Elliot Chance , > pgsql-www > Subject: Re: [pgsql-www] Forums at postgresql.com.au > > On Fri, Nov 19, 2010 at 16:14, Alvaro Herrera > wrote: >> Excerpts from Da

Re: [GENERAL] [pgsql-www] Forums at postgresql.com.au

2010-11-20 Thread Elliot Chance
On 20/11/2010, at 11:52 PM, Magnus Hagander wrote: > On Sat, Nov 20, 2010 at 12:26, Elliot Chance wrote: >> >> On 20/11/2010, at 9:52 PM, Magnus Hagander wrote: >> >>> On Sat, Nov 20, 2010 at 02:57, Elliot Chance wrote: On 20/11/2010, at 3:58 AM, Magnus Hagander wrote: I

[GENERAL] Fwd: [pgsql-www] Forums at postgresql.com.au

2010-11-20 Thread Elliot Chance
On 20/11/2010, at 4:04 AM, Alvaro Herrera wrote: > Excerpts from Dave Page's message of vie nov 19 12:22:09 -0300 2010: >> On Fri, Nov 19, 2010 at 3:14 PM, Alvaro Herrera >> wrote: > >>> I wonder if the mailing list would alow posting from an address like >>> forums+1...@postgresql.com.au if onl

[GENERAL] Fwd: [pgsql-www] Forums at postgresql.com.au

2010-11-20 Thread Elliot Chance
On 20/11/2010, at 9:52 PM, Magnus Hagander wrote: > On Sat, Nov 20, 2010 at 02:57, Elliot Chance wrote: >> >> On 20/11/2010, at 3:58 AM, Magnus Hagander wrote: >> >> On Fri, Nov 19, 2010 at 16:14, Alvaro Herrera >> wrote: >> >> Excerpts from Dave Page's message of vie nov 19 11:43:34 -0300 2

Re: [GENERAL] Survey on backing up unlogged tables: help us with PostgreSQL development!

2010-11-20 Thread Ron Mayer
Josh Berkus wrote: >> With the current patches, the data survives a restart just fine. > > Per -hackers, that's not guarenteed. "Not guaranteed" is fine. What people are asking for is "often survives". AFAIK we don't truncate the log file created by the log_filename GUC on every unclean crash an

Re: [GENERAL] The first dedicated PostgreSQL forum

2010-11-20 Thread Radosław Smogura
Hi, > As has been said previously, an unlinked forum (one which has no > interaction with the mailing list) is destined to fail, as others have > in the past. It's creates a fragmented community and poor support on > such a forum would reflect badly on the PostgreSQL community. > > Mailing lists

Re: [GENERAL] newbie question - delete before insert

2010-11-20 Thread Ashish Karalkar
On 11/20/2010 02:43 PM, Thomas Kellerer wrote: > Grant Mckenzie wrote on 20.11.2010 07:00: >> How do people implement insert or upate ( otherwise known as upsert ) >> behaviour in postgres i.e. insert a row if it's key does not exist in >> the database else update the existing row? >> > > You can s

Re: [GENERAL] newbie question - delete before insert

2010-11-20 Thread Thomas Kellerer
Grant Mckenzie wrote on 20.11.2010 07:00: How do people implement insert or upate ( otherwise known as upsert ) behaviour in postgres i.e. insert a row if it's key does not exist in the database else update the existing row? You can simply send the UPDATE, if nothing was updated, it's safe to