[GENERAL] how best to see session data in triggers, or auditing methods

2012-05-09 Thread Darren Duncan
So, I have a question, either on how to best use session variables from triggers, or on how to best solve my actual problem, of effective auditing. I'm working on a general record auditing system for a new database, that is like the common approach of having automatic datestamp fields plus au

Re: [GENERAL] how to amend SQL standard to add comments?

2012-05-09 Thread Aleksey Tsalolikhin
On Sun, May 6, 2012 at 10:49 AM, Thomas Kellerer wrote: > > You can use multi-line comments with /* .. */ to send this information to > the server: > > SELECT /* Query Author: Bob Programmer. >          Purpose: Pull the student ID number, we'll need it to enroll the > student for classes */ >    

Re: [GENERAL] 2 machines, same database, same query, 10 times slower?

2012-05-09 Thread Tomas Vondra
On 9.5.2012 22:50, Antonio Goméz Soto wrote: > Tomas, > > running vacuum full cdr brought down the query time to 4 seconds.. Fine. I'd recommend checking the other tables too - if this one was bloated, it's likely there might be others. Anyway, you should find out how this happened and fix it. T

Re: [GENERAL] 2 machines, same database, same query, 10 times slower?

2012-05-09 Thread Antonio Goméz Soto
Tomas, running vacuum full cdr brought down the query time to 4 seconds.. Thanks a lot, Antonio Op 08-05-12 21:15, Tomas Vondra schreef: > On 8.5.2012 20:32, Antonio Goméz Soto wrote: Do this on both machines to verify that SELECT relpages, reltuples FROM pg_class WHERE relnam

[GENERAL] Retrieving multiple columns from a subquery

2012-05-09 Thread Chris Hanks
Hello - I have two tables: CREATE TABLE users ( id serial NOT NULL, created_at timestamp with time zone NOT NULL, last_seen_at timestamp with time zone NOT NULL, -- some other columns... ) CREATE TABLE emails ( user_id integer NOT NULL, address text NOT NULL, created_at timestamp w

Re: [GENERAL] Strange crash logs

2012-05-09 Thread Rocco Zanni
Hi Tom, we've discovered more informations in the meanwhile. It seems that a bug in our backup tools caused a freeze in the database filesystem. The tool was stucked inside an xfs_freeze for a several minutes and caused the kernel to terminate processes locked waiting for write lock. One of

[GENERAL] PostgreSQL Session #4 : Call for Papers

2012-05-09 Thread Guillaume Lelarge
== PostgreSQL Session #4 : Call for Papers == After three successful sessions dedicated to the new features of PostgreSQL 9.0 (february 2011), to PostGIS (june 2011), and to replication systems (february 2012), we'd like to announce that the 4th PostgreSQL Session will be held on October

Re: [GENERAL] Issue with rsync based incremental backup : postgres: startup process waiting for 0000000100000001000000D2

2012-05-09 Thread Samba
Thanks Mike, It worked! I had even setup streaming replication after doing incremental replication, without needing to stop postgres on the primary server. Here is the script i came up with : #!/bin/bash > if [ $# -ne 1 ]; then > echo "you must specify the hostname of the backup server"; > exit

[GENERAL] config file question between versions 7.4 - 9.1

2012-05-09 Thread Randy Johnson
Hello, in the config file for 7.4 we have an entry: shared_buffers = 1000 # min 16, at least max_connections*2, 8KB each in 9.1 the default is: shared_buffers = 32MB max connections is the default 100 Do I need to make any adjustments or can I leave it at the default? The machine is dedicat

Re: [GENERAL] Strange crash logs

2012-05-09 Thread Tom Lane
Rocco Zanni writes: > someone can help me understanding what happened in this crash logs? > http://pastebin.com/0ruR4egm What was happening *before* the lines you showed? The information there seems to indicate that something got stuck while holding the ProcStructLock, but there's no way to tell

Re: [GENERAL] Seeking performance advice: Index for "recent entries"

2012-05-09 Thread Chris Angelico
On Thu, May 10, 2012 at 12:36 AM, Tom Lane wrote: > Chris Angelico writes: >> On Wed, May 9, 2012 at 2:52 PM, Tom Lane wrote: >>> I think this falls under the rubric of "premature optimization is the >>> root of all evil".  Just use a plain index on the timestamptz column >>> and be happy.  Sear

Re: [GENERAL] Seeking performance advice: Index for "recent entries"

2012-05-09 Thread Tom Lane
Chris Angelico writes: > On Wed, May 9, 2012 at 2:52 PM, Tom Lane wrote: >> I think this falls under the rubric of "premature optimization is the >> root of all evil".  Just use a plain index on the timestamptz column >> and be happy.  Searches that only look at the extremal values of a >> column

Re: [GENERAL] relpages sudden increase

2012-05-09 Thread Richard Harley
On 09/05/12 00:00, Tomas Vondra wrote: On 8.5.2012 19:27, Richard Harley wrote: I currently do nightly database dumps on a ton of small dbs that are increasing around 2-3mb per day. Suddenly, in a recent backup file, one db in particular jumped from 55mb to 122mb overnight. Well, I wouldn't cal

Re: [GENERAL] PostgreSQL Magazine #01 is out !

2012-05-09 Thread Simon Riggs
On 9 May 2012 13:02, PostgreSQL Magazine wrote: > Dear PostgreSQL users, > > I am very pleased to announce the release of the first issue of > PostgreSQL Magazine. > > This issue #01 is brought to you thanks to the collective work of > dozen of people. Writers, Editors, Reviewers. Kudos to them al

[GENERAL] Strange crash logs

2012-05-09 Thread Rocco Zanni
Hi, someone can help me understanding what happened in this crash logs? http://pastebin.com/0ruR4egm PostgreSQL version is: - PostgreSQL 9.1.2 on x86_64-pc-linux-gnu, compiled by gcc-4.6.real (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1, 64-bit Thanks, Rocco --- Rocco Zanni rocco.za...@spreaker.c

Re: [GENERAL] PostgreSQL Magazine #01 is out !

2012-05-09 Thread hidayat365
Nice... Thanks a lot . Sent from my BlackBerry® powered by Sinyal Kuat INDOSAT -Original Message- From: PostgreSQL Magazine Sender: pgsql-general-owner@postgresql.orgDate: Wed, 09 May 2012 14:02:47 To: Reply-To: PostgreSQL Magazine Subject: [GENERAL] PostgreSQL Magazine #01 is out !

Re: [GENERAL] PostgreSQL Magazine #01 is out !

2012-05-09 Thread Merlin Moncure
On Wed, May 9, 2012 at 7:02 AM, PostgreSQL Magazine wrote: > Dear PostgreSQL users, > > I am very pleased to announce the release of the first issue of > PostgreSQL Magazine. > > This issue #01 is brought to you thanks to the collective work of > dozen of people. Writers, Editors, Reviewers. Kudos

[GENERAL] PostgreSQL Magazine #01 is out !

2012-05-09 Thread PostgreSQL Magazine
Dear PostgreSQL users, I am very pleased to announce the release of the first issue of PostgreSQL Magazine. This issue #01 is brought to you thanks to the collective work of dozen of people. Writers, Editors, Reviewers. Kudos to them all ! Here's a quick view of the ToC : - PostgreSQL 9.1 : 1

Re: [GENERAL] Use LISTEN/NOTIFY between different databases

2012-05-09 Thread Marko Kreen
On Mon, May 7, 2012 at 11:52 PM, John R Pierce wrote: >> 2012/5/7 John R Pierce mailto:pie...@hogranch.com>> >>    On 05/07/12 1:13 PM, Igor wrote: >> I understand this. But I need "link" between two clients, connected to >> different databases. >> >> Its real situation. We use sharded cluster bas