[GENERAL] Value to long for type ....: Columnname missing

2012-04-12 Thread Thomas Guettler
Hi, I think it would be very good, if postgresql reports which column is too small: Value to long for type character varying(1024) (message translated from german to english) Is there a reason not to report the column name? How can you report feature request? Thomas Güttler -- Thomas

[GENERAL] Writing data to a text file based on a trigger event...

2012-04-12 Thread raghupradeep
Hi , I am basically a MySQL DBA and have little idea on PostgreSQL. In our environment we have an application which is using PostgreSQL as its back end. The application logs the status of the jobs running in it to a table in this database i.e when a job starts it inserts a new row to this table an

Re: [GENERAL] Writing data to a text file based on a trigger event...

2012-04-12 Thread François Beausoleil
Le jeudi 12 avril 2012 à 06:58, raghupradeep a écrit : > What I need to know is it possible to write a trigger which will write the > data of the row whose status column gets updated to a text file? I would advise simply INSERTing the old values into a new table. This would be more flexible in

Fwd: Re: [GENERAL] Searchable chess positions in a Postgress DB

2012-04-12 Thread Gavin Flower
Original Message Subject:Re: [GENERAL] Searchable chess positions in a Postgress DB Date: Fri, 13 Apr 2012 00:33:17 +1200 From: Gavin Flower Organisation: ArchiDevSys To: Sidney Cadot On 12/04/12 01:14, Sidney Cadot wrote: Hi Gavin, I appreciate the n

Re: [GENERAL] Searchable chess positions in a Postgress DB

2012-04-12 Thread Merlin Moncure
2012/4/11 Ondrej Ivanič : > Hi, > > On 11 April 2012 17:15, Sidney Cadot wrote: >> I have written code to extract these positions, and now I want to put >> them into a Postgres database. Specifically, I want to do this in a >> way that allows *fast* lookups of positions, e.g. "give me all >> posit

Re: [GENERAL] non-static LIKE patterns

2012-04-12 Thread Tom Lane
haman...@t-online.de writes: > Tom Lane wrote: > If you want it to be bulletproof, what I'd think about is something like > WHERE second.path LIKE quote_like(first.path)||'%' > Just out of curiosity: wouldn't that (as well as using non-static like) > be an enormous performance problem? Well

[GENERAL] Two entries with the same primary key

2012-04-12 Thread Ivan Evtuhovich
Hello, More then month ago we upgrade DB from 9.0 to 9.1 with pg_upgrade. Then we move DB to another server with standard pg streaming replication. Now we have two entries with the same primary key. And I do not know what to do. SELECT ctid, id from billing_invoices where id = 27362891; cti

[GENERAL] recommended schema diff tools?

2012-04-12 Thread Welty, Richard
can anyone recommend an open source tool for diffing schemas? (it should go without saying that i'm looking for ddl to update production and QA DBs from development DBs, but i'll say it, just in case.) thanks, richard

Re: [GENERAL] Two entries with the same primary key

2012-04-12 Thread Merlin Moncure
On Thu, Apr 12, 2012 at 9:20 AM, Ivan Evtuhovich wrote: > Hello, > > More then month ago we upgrade DB from 9.0 to 9.1 with pg_upgrade. Then we > move DB to another server with standard pg streaming replication. > > Now we have two entries with the same primary key. And I do not know what to > do.

Re: [GENERAL] recommended schema diff tools?

2012-04-12 Thread Chris Angelico
On Fri, Apr 13, 2012 at 12:57 AM, Welty, Richard wrote: > can anyone recommend an open source tool for diffing schemas? > > (it should go without saying that i'm looking for ddl to update production > and QA DBs from development DBs, but i'll say it, just in case.) We toyed with this exact issue

Re: [GENERAL] recommended schema diff tools?

2012-04-12 Thread Robert Gravsjö
(sorry for top posting but I'm using a less than sane email client) I came across SQL Power Architect not long ago and it might be something you could use. http://code.google.com/p/power-architect/ I haven't had much time to look at it though. Regards, roppert Från: pgsql-general-ow...@pos

Re: [GENERAL] recommended schema diff tools?

2012-04-12 Thread Merlin Moncure
On Thu, Apr 12, 2012 at 10:10 AM, Chris Angelico wrote: > On Fri, Apr 13, 2012 at 12:57 AM, Welty, Richard wrote: >> can anyone recommend an open source tool for diffing schemas? >> >> (it should go without saying that i'm looking for ddl to update production >> and QA DBs from development DBs, b

Re: [GENERAL] recommended schema diff tools?

2012-04-12 Thread Chris Angelico
On Fri, Apr 13, 2012 at 1:28 AM, Merlin Moncure wrote: > (although > they can be great from reporting or double checking standpoint). Good point. Double-checking your patch script may well be worth doing. It ought, in theory, be possible to load up a copy of your existing database, spin up a bran

Re: [GENERAL] recommended schema diff tools?

2012-04-12 Thread Thomas Kellerer
Chris Angelico wrote on 12.04.2012 17:10: patchlevel = query("select patchlevel from config") switch (patchlevel) { default: print("Unknown patch level!"); break; case 1: print("20120216: Adding Foobar columns to Quux") query("ALTER TABLE Quux ADD foo smallint not null default 0,

Re: [GENERAL] recommended schema diff tools?

2012-04-12 Thread Chris Angelico
On Fri, Apr 13, 2012 at 2:02 AM, Thomas Kellerer wrote: > Sounds like you implement something very similar to Liquibase. Never heard of it till today; just googled it. Looks cool. At first glance, yes, does appear similar; but what we're doing is WAY less sophisticated. ChrisA -- Sent via pgsq

Re: [GENERAL] recommended schema diff tools?

2012-04-12 Thread Thomas Kellerer
Welty, Richard wrote on 12.04.2012 16:57: can anyone recommend an open source tool for diffing schemas? (it should go without saying that i'm looking for ddl to update production and QA DBs from development DBs, but i'll say it, just in case.) You might want to have a look at SQL Workbench/J.

Re: [GENERAL] trigger when clause

2012-04-12 Thread Andy Chambers
On Tue, Apr 10, 2012 at 5:10 PM, Jeff Davis wrote: > On Tue, 2012-04-10 at 16:15 -0400, Andy Chambers wrote: > > > Does anyone know the time complexity of the algorithm used to handle > > triggers with a when clause? > > It's done with a linear scan of all triggers, testing the WHEN clause > for

Re: [HACKERS] [GENERAL] [streaming replication] 9.1.3 streaming replication bug ?

2012-04-12 Thread Fujii Masao
On Thu, Apr 12, 2012 at 4:09 AM, Michael Nolan wrote: > -- Forwarded message -- > From: Michael Nolan > Date: Wed, 11 Apr 2012 14:48:18 -0400 > Subject: Re: [HACKERS] [GENERAL] [streaming replication] 9.1.3 > streaming replication bug ? > To: Robert Haas > > On Wed, Apr 11, 2012

[GENERAL] PGBouncer help (how to get it working)

2012-04-12 Thread Phoenix Kiula
I had pgbouncer working somehow, but we have switched servers recently and now I cannot for the life of me figure out again how to set it up. Online guides say things like "create a user ID". Well, where? Inside PG the database? Or in my CentOS system? Here's my "/etc/pgbouncer.ini": [datab

Re: [GENERAL] PGBouncer help (how to get it working)

2012-04-12 Thread Scott Marlowe
On Thu, Apr 12, 2012 at 11:12 AM, Phoenix Kiula wrote: > >   WARNING: password file "/root/.pgpass" has group or world access; >   permissions should be u=rw (0600) or less >   psql: ERROR:  No such user: MYSITE_pgbouncer Pretty sure the error is just the perms on that file. Set them to 0600 and

[GENERAL] regexp operator for array element compares needed

2012-04-12 Thread Gauthier, Dave
Hi: v8.3.4 on linux In plpgsql, I have something like this... if ((string_to_array(check_values_text,',') <@ string_to_array((select permitted_values from bi_constraints where bicolumn = 'fivr'),',')) = 'f') It's just testing all the values in the check_values_text csv are in permitted_values

[GENERAL] Re: Hot Standby - ERROR: canceling statement due to conflict with recovery

2012-04-12 Thread Francois
One solution, for backups anyway, is to pause the replication on the slave machines with the command: pg_xlog_replay_pause() and pg_xlog_replay_resume(). We still don't have a solution for long running queries, mayber have a mechanism to retry them when they fail with that specific error. -- View

Re: [GENERAL] Two entries with the same primary key

2012-04-12 Thread Merlin Moncure
On Thu, Apr 12, 2012 at 9:20 AM, Ivan Evtuhovich wrote: > Hello, > > More then month ago we upgrade DB from 9.0 to 9.1 with pg_upgrade. Then we > move DB to another server with standard pg streaming replication. > > Now we have two entries with the same primary key. And I do not know what to > do.

[GENERAL] Installer Questions (NSIS)

2012-04-12 Thread Bret Stern
I'm starting to put together an install script using NSIS, for our client application. For the Postgresql database, I've been using the installer from postgresql.org, courtesy of Dave Page. Being an anal programmer type, I may want to pursue a little more control over how our application is dis

Re: [GENERAL] Searchable chess positions in a Postgress DB

2012-04-12 Thread Gavin Flower
On 11/04/12 21:24, Gavin Flower wrote: On 11/04/12 19:15, Sidney Cadot wrote: Dear all, As a hobby project, I am toying around with a database containing about 5 million chess games. On average, these games have about 80 positions (~ 40 moves by both black and white), which means there are abou

Re: [GENERAL] Searchable chess positions in a Postgress DB

2012-04-12 Thread Michael Nolan
On Thu, Apr 12, 2012 at 4:50 PM, Gavin Flower wrote: > On 11/04/12 21:24, Gavin Flower wrote: > > On 11/04/12 19:15, Sidney Cadot wrote: > > Dear all, > > As a hobby project, I am toying around with a database containing > about 5 million chess games. On average, these games have about 80 > posi

Re: [GENERAL] Re: Hot Standby - ERROR: canceling statement due to conflict with recovery

2012-04-12 Thread raghu ram
On Fri, Apr 13, 2012 at 2:09 AM, Francois wrote: > One solution, for backups anyway, is to pause the replication on the slave > machines with the command: pg_xlog_replay_pause() and > pg_xlog_replay_resume(). We still don't have a solution for long running > queries, mayber have a mechanism to r

Re: [GENERAL] recommended schema diff tools?

2012-04-12 Thread raghu ram
On Thu, Apr 12, 2012 at 9:35 PM, Thomas Kellerer wrote: > Welty, Richard wrote on 12.04.2012 16:57: > > can anyone recommend an open source tool for diffing schemas? >> >> (it should go without saying that i'm looking for ddl to update >> production and QA DBs from development DBs, but i'll say

Re: [GENERAL] recommended schema diff tools?

2012-04-12 Thread Damian Carey
On Fri, Apr 13, 2012 at 12:57 AM, Welty, Richard wrote: > ** > > can anyone recommend an open source tool for diffing schemas? > > (it should go without saying that i'm looking for ddl to update production > and QA DBs from development DBs, but i'll say it, just in case.) > > thanks, >richard

Re: [GENERAL] PGBouncer help (how to get it working)

2012-04-12 Thread Phoenix Kiula
On Fri, Apr 13, 2012 at 2:41 AM, Scott Marlowe wrote: > On Thu, Apr 12, 2012 at 11:12 AM, Phoenix Kiula > wrote: >> >>   WARNING: password file "/root/.pgpass" has group or world access; >>   permissions should be u=rw (0600) or less >>   psql: ERROR:  No such user: MYSITE_pgbouncer > > Pretty s

Re: [GENERAL] PGBouncer help (how to get it working)

2012-04-12 Thread Raghavendra
On Fri, Apr 13, 2012 at 11:00 AM, Phoenix Kiula wrote: > On Fri, Apr 13, 2012 at 2:41 AM, Scott Marlowe > wrote: > > On Thu, Apr 12, 2012 at 11:12 AM, Phoenix Kiula > wrote: > >> > >> WARNING: password file "/root/.pgpass" has group or world access; > >> permissions should be u=rw (0600) or

Re: [GENERAL] PGBouncer help (how to get it working)

2012-04-12 Thread Raghavendra
> > On Fri, Apr 13, 2012 at 11:00 AM, Phoenix Kiula > wrote: > >> On Fri, Apr 13, 2012 at 2:41 AM, Scott Marlowe >> wrote: >> > On Thu, Apr 12, 2012 at 11:12 AM, Phoenix Kiula < >> phoenix.ki...@gmail.com> wrote: >> >> >> >> WARNING: password file "/root/.pgpass" has group or world access; >> >

[GENERAL] Issue of upgrading from 9.0.4 to 9.1.3

2012-04-12 Thread Zhidong She
Hi All, We used 9.0.4 before and recently we plan to upgrade to 9.1.3. During the test, we found a issue related to escape letter as below: in 9.0.4, the sql is correct insert into test values('abc\'a'); but in 9.1.3, the postgresql denied the same sql, then it worked after I changed it to inser

Re: [GENERAL] Issue of upgrading from 9.0.4 to 9.1.3

2012-04-12 Thread John R Pierce
On 04/12/12 11:09 PM, Zhidong She wrote: but in 9.1.3, the postgresql denied the same sql, then it worked after I changed it to insert into test values('abc''a'); How to configure 9.1.3 and let it also accept \ as the escpage? Could someone help me out? use E'abc\'a', this is the SQL standard

Re: [GENERAL] Issue of upgrading from 9.0.4 to 9.1.3

2012-04-12 Thread Raghavendra
On Fri, Apr 13, 2012 at 11:39 AM, Zhidong She wrote: > Hi All, > > We used 9.0.4 before and recently we plan to upgrade to 9.1.3. During > the test, we found a issue related to escape letter as below: > > in 9.0.4, the sql is correct > insert into test values('abc\'a'); > > but in 9.1.3, the post

Re: [GENERAL] Two entries with the same primary key

2012-04-12 Thread Ivan Evtuhovich
Hi, our current version both on master and slave is PostgreSQL 9.1.3 on x86_64-pc-linux-gnu, compiled by gcc-4.4.real (Debian 4.4.5-8) 4.4.5, 64-bit But as i remember, we start streaming replication on 9.1.2 and then upgrade to 9.1.3. My ops now on vacations, and we will make standby resync on Mo