Re: [GENERAL] Is there a way to add a detail message in a warning with pl/Python?

2013-01-30 Thread Stuart Bishop
On Tue, Jan 29, 2013 at 8:03 PM, DANIEL CRISTIAN CRUZ wrote: > Hello, > > I build a function and added some warnings where the id of the affected > rows are inside it; and would be nice to put it into a detail, not in > the message, since pgbadger can group it and I can see clearly what is > wrong

Re: [GENERAL] Optimizing query?

2013-01-30 Thread Vincent Veyron
Le mercredi 30 janvier 2013 à 11:08 +, wolfg...@noten5.maas-noten.de a écrit : > Hi, > > I am trying to match items from 2 tables based on a common string. > One is a big table which has one column with entries like XY123, ABC44, etc > The table has an index on that column. > The second table

Re: [GENERAL] trouble with upgrade from 9.0 (many schemas and tables)

2013-01-30 Thread Groshev Andrey
30.01.2013, 18:47, "Jeff Janes" : > On Tue, Jan 29, 2013 at 9:23 PM, Groshev Andrey wrote: > >>  Hello! >>  I update the databases to version 9.1. >>  Today, faced with a new challenge. >>  The database itself is not very big 60G, but has ~ 164,000 tables in 1260 >> schemes. > > Are the schemas

Re: [GENERAL] psql question

2013-01-30 Thread Tom Lane
Steve Crawford writes: > On 01/30/2013 01:51 PM, Little, Douglas wrote: >> p1gp1=> \set env dev >> p1gp1=> \i P1GP1_ETL_STAGE_TBLS_BIO6113_100.:env.sql >> P1GP1_ETL_STAGE_TBLS_BIO6113_100.:env.sql: No such file or directory >> >> Any thoughts on how I might get this to work? > Perhaps try concat

Re: [GENERAL] naming of wal-archives

2013-01-30 Thread Jeff Janes
On Wed, Jan 30, 2013 at 3:13 PM, Adrian Klaver wrote: > On 01/30/2013 11:16 AM, Jeff Janes wrote: >> >> On Wed, Jan 30, 2013 at 12:58 AM, Neil Worden >> wrote: >> >> >>> If not, how do i prevent files from being overwritten when using an >>> archive_command ? >> >> >> It is the archive_command's

[GENERAL] Version numbers for binaries

2013-01-30 Thread deepak
Hi ! We bundle Postgres into a Windows MSI, Postgres built with VS2008. One of the issues we ran into recently is Windows getting confused with the file versions of Postgres binaries, confused meaning, it was treating newer binaries as older, and hence skipping copying certain files during an upg

Re: [GENERAL] naming of wal-archives

2013-01-30 Thread Adrian Klaver
On 01/30/2013 11:16 AM, Jeff Janes wrote: On Wed, Jan 30, 2013 at 12:58 AM, Neil Worden wrote: If not, how do i prevent files from being overwritten when using an archive_command ? It is the archive_command's job to refuse to overwrite. From the docs: "It is advisable to test your propose

Re: [GENERAL] psql question

2013-01-30 Thread Steve Crawford
On 01/30/2013 01:51 PM, Little, Douglas wrote: I'm looking for a way where I can tailor DDL scripts for deployment with environment variables. Support I have a requirement to prefix table names with dev_ , fqa_, or prod_ I'd like to have a file for each env with their own unique settings -

[GENERAL] psql question

2013-01-30 Thread Little, Douglas
I'm looking for a way where I can tailor DDL scripts for deployment with environment variables. Support I have a requirement to prefix table names with dev_ , fqa_, or prod_ I'd like to have a file for each env with their own unique settings - host, dbname Dev.sql \set env dev Fq

Re: [GENERAL] naming of wal-archives

2013-01-30 Thread Jeff Janes
On Wed, Jan 30, 2013 at 12:58 AM, Neil Worden wrote: > > As you can see it recycles existing files by using them with their exact > name as they already exist (next file to be overwritten is the ..91-file). > So far so good. I have, just a few minutes ago, set archive_mode to "on" and > set an arc

[GENERAL] Postbix Zabbix help

2013-01-30 Thread Raju Angani
Hi, I';m exploring zabbix/postbix, I have downloaded the vmware/zabbix appliance and got the zabbix working. I installed postbix as the documentation says, and configured to connect to remote postgres. I can see the connection happening from zabbix to postgres, but I don't see any data for the po

[GENERAL] Optimizing query?

2013-01-30 Thread wolfgang
Hi, I am trying to match items from 2 tables based on a common string. One is a big table which has one column with entries like XY123, ABC44, etc The table has an index on that column. The second table is, typically, much smaller select from tab1, tab2 where tab1.code = tab2.code; This wo

[GENERAL]

2013-01-30 Thread News Subsystem
Tue, 29 Jan 2013 20:41:58 -0800 (PST) 29 Jan 2013 20:41:58 -0800 (PST) X-Newsgroups: pgsql.general Date: Tue, 29 Jan 2013 20:41:57 -0800 (PST) In-Reply-To: Complaints-To: groups-ab...@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=76.167.116.131; posting-acco

[GENERAL] naming of wal-archives

2013-01-30 Thread Neil Worden
Hi all, i am not sure whether i have fully understood the implications of archiving wal-files and i have a few questions. We currently keep a rather long backlog of wal-files, since we have a few hot-standbys over slow and unreliable lines that might fall back. So this is an extract from my curr

Re: [GENERAL] Is there a way to add a detail message in a warning with pl/Python?

2013-01-30 Thread DANIEL CRISTIAN CRUZ
Em 29/01/2013 17:30, Adrian Klaver escreveu: > Why not: > > DO $$ > plpy.warning('test, detail') > $$ LANGUAGE plpythonu; > > In log: > > WARNING: test, detail > Because pgBadger doesn't use it this way: http://dalibo.github.com/pgbadger/example.html#NormalizedErrorsMostFrequentReport

[GENERAL] Windows Phone/Postgresql

2013-01-30 Thread Bret Stern
I'm thinking about picking up a new windows phone, and would like to connect to a postgresql server from the phone. Anyone have some how-to links. I've done some initial Google searches, and found some leads, but hoping to draw on some experience in the group. Regards, Bret Stern -- Sent vi

Re: [GENERAL] database design best pratice help

2013-01-30 Thread Wolfgang Keller
> In my db I have about one hundred tables like this: > > code > description > > To avoid to have a so great number of similar tables in the db > I wonder if it is a good idea to unify all these tables in one big > table like this: > > id > code > table_ name > description Bad idea. E.g. how d

Re: [GENERAL] pg_Restore

2013-01-30 Thread John R Pierce
On 1/30/2013 5:12 AM, C. Bensend wrote: >Don't know exactly the name of the ntfs property, if i remember well it's >recover point, but haven't used Windows for a while. I think you're talking about shadow copies. the UI and usability of NTFS shadow copies is quite frustrating. you can create

[GENERAL] Cannot start PG as a Windows Service on Server 2008 and Windows 8

2013-01-30 Thread Brian Janes
Hi all, I can successfully run PG as a service in Windows XP with no problems, but not in Windows Server 2008 or Windows 8, even though the same procedure is being used. This is what I get with Windows XP, which is expected: C:\>pg_ctl register -N postgres -U btjanes -P XXX -D c:\bin\rtda\pgdata

[GENERAL] Query Parallelizing with dblink

2013-01-30 Thread AI Rumman
Hi All, I made an idea to utilize multiple core for Postgresql query. I used dblink to achieve this task. You may find it: http://www.rummandba.com/2013/01/postgresql-query-parallelizing-with.html It is just a basic idea and completely usable for my data model. But I share it with you all so tha

Re: [GENERAL] Optimizing select count query which often takes over 10 seconds

2013-01-30 Thread Jeff Janes
On Tue, Jan 29, 2013 at 11:41 PM, Alexander Farber wrote: > > When programming other languages, I never do > if (x != 0) { x = 0; } but just set x = 0 straight away. Most other languages are not transactional and durable. Databases are different. Cheers, Jeff -- Sent via pgsql-general maili

Re: [GENERAL] Is there a way to add a detail message in a warning with pl/Python?

2013-01-30 Thread Adrian Klaver
On 01/30/2013 02:49 AM, DANIEL CRISTIAN CRUZ wrote: Em 29/01/2013 17:30, Adrian Klaver escreveu: Why not: DO $$ plpy.warning('test, detail') $$ LANGUAGE plpythonu; In log: WARNING: test, detail Because pgBadger doesn't use it this way: http://dalibo.github.com/pgbadger/example.htm

Re: [GENERAL] trouble with upgrade from 9.0 (many schemas and tables)

2013-01-30 Thread Tom Lane
Groshev Andrey writes: > I update the databases to version 9.1. > Today, faced with a new challenge. > The database itself is not very big 60G, but has ~ 164,000 tables in 1260 > schemes. > I tried and pg_upgrade and pg_dumpall and pg_dump. > But they all work very, very long time. This isn't v

Re: [GENERAL] trouble with upgrade from 9.0 (many schemas and tables)

2013-01-30 Thread Jeff Janes
On Tue, Jan 29, 2013 at 9:23 PM, Groshev Andrey wrote: > Hello! > I update the databases to version 9.1. > Today, faced with a new challenge. > The database itself is not very big 60G, but has ~ 164,000 tables in 1260 > schemes. Are the schemas all about the same size (in number of tables)? The

Re: [GENERAL] optimize query?

2013-01-30 Thread hamann . w
Bob Futrelle wrote: If looking for the variants with a single suffixed character is all you'll ever need to do: Do a single pass on the large table, after creating a field, 'trunc' that contains a truncated version of the item, e.g., adding XY423 to trunc for each entry of the form XY423A, or XY4

Re: [GENERAL] finding if a period is multiples of a given interval

2013-01-30 Thread c k
Thanks. After some hacking it solved my problems using select date_part('days', age('06/01/2010'::date ,'04/01/2010'::date)); Regards, On Mon, Jan 28, 2013 at 9:32 PM, Adrian Klaver wrote: > On 01/28/2013 07:17 AM, c k wrote: > >> I know that. I have to check the period (dates entered by user

Re: [GENERAL] pg_Restore

2013-01-30 Thread C. Bensend
> Don't know exactly the name of the ntfs property, if i remember well it's > recover point, but haven't used Windows for a while. I think you're talking about shadow copies. :) Benny -- "The very existence of flamethrowers proves that sometime, somewhere, someone said to themselves, 'You kn

Re: [GENERAL] Optimizing select count query which often takes over 10 seconds

2013-01-30 Thread Kevin Grittner
Alexander Farber wrote: > The cronjob gives me now occasionally: > > /* reset and then update medals count */ > update pref_users set medals = 0; > psql:/home/afarber/bin/clean-database.sql:63: ERROR:  deadlock detected > DETAIL:  Process 31072 waits for ShareLock on transaction 124735679; blocke

Re: [GENERAL] Optimizing select count query which often takes over 10 seconds

2013-01-30 Thread Kevin Grittner
Alexander Farber wrote: > Kevin Grittner wrote: >> Alexander Farber wrote: >> >>> update pref_users set medals = 0; >>> UPDATE 223456 >> >> You're probably going to like your performance a lot better if >> you modify that to: >> >> update pref_users set medals = 0 where medals <> 0; > > is it re

Re: [GENERAL] pg_Restore

2013-01-30 Thread Eduardo Morras
On Mon, 21 Jan 2013 22:16:00 +0530 bhanu udaya wrote: > Hello All, > Can we achieve this template or pg_Restore in less than 20 minutes time. Any > more considerations. Kindly reply. Thanks and RegardsRadha Krishna From: > udayabhanu1...@hotmail.com Perhaps you can use the ntfs snapshot featu

[GENERAL] optimize query?

2013-01-30 Thread hamann . w
Hi, I am trying to match items from 2 tables based on a common string. One is a big table which has one column with entries like XY123, ABC44, etc The table has an index on that column. The second table is, typically, much smaller select from tab1, tab2 where tab1.code = tab2.code; This wor

Re: [GENERAL] Fwd: Functions not visible in pg_stat_user_functions view

2013-01-30 Thread Bartosz Dmytrak
2013/1/30 Albe Laurenz > The most likely explanation for what you observe is that > the functions have never been called since track_functions > has been set to "all". > > You can see if that is indeed the reason by calling one > of your "invisible" functions and see if it becomes > visible after

Re: [GENERAL] Fwd: Functions not visible in pg_stat_user_functions view

2013-01-30 Thread Albe Laurenz
Bartosz Dmytrak wrote: > and this is strange for me. > I have few DBs with the same function (copy -> paste), in one DB they are > tracked (visible in > pg_stat_user_functions) in other not. In DB where some functions are not > tracked, others are visible - > no issue. I cannot find any logical c

Re: [GENERAL] Dropping default privileges.

2013-01-30 Thread Tim Uckun
Thanks. Worked. On Wed, Jan 30, 2013 at 9:12 PM, Albe Laurenz wrote: > Tim Uckun wrote: drop role tim; ERROR: role "tim" cannot be dropped because some objects depend on it DETAIL: owner of default privileges on new relations belonging to role tim in schema strongmail >>> >

Re: [GENERAL] Dropping default privileges.

2013-01-30 Thread Albe Laurenz
Tim Uckun wrote: >>> drop role tim; >>> ERROR: role "tim" cannot be dropped because some objects depend on it >>> DETAIL: owner of default privileges on new relations belonging to >>> role tim in schema strongmail >> >> DROP OWNED BY ought to get rid of that. > > > Just to be clear. > > I don'