Re: [GENERAL] if-clause to an exiting statement

2010-12-17 Thread Rob Sargent
Jasen Betts wrote: On 2010-12-07, Kobi Biton k...@comns.co.il wrote: hi i am a newbie to sql statments , I am running postgres 8.1 with application called opennms version 1.8.5 due to an application bug queries that I execute aginst the DB which returns raw-count=0 are being ignored and

[GENERAL] Recommended replication solution?

2010-12-17 Thread Marcin Krol
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello everyone, Yes I know, size one not fits all, I specifically need: * preferably multi-master * local read, cluster-wide write * a solution that allows me to maintain consistency between masters in case of single node failure * last but not

[GENERAL] Table both does not and does exist! wth?

2010-12-17 Thread Melvin Davidson
PostgreSQL 8.3.11 on i686-redhat-linux-gnu, compiled by GCC gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-46) Linux version 2.6.18-194.26.1.el5 (mockbu...@builder10.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Tue Nov 9 12:54:40 EST 2010 How is this possible? I've been working

Re: [GENERAL] Searing array fields - or should I redesign?

2010-12-17 Thread Jim Nasby
On Dec 16, 2010, at 11:26 AM, Vincent Veyron wrote: table logdetail logid int attribute varchar/int value decimal textvalue varchar You can retrieve logentries for specific vehicles, timeframes and attributes - and you can extend more log attributes without changing the database

Re: [GENERAL] Table both does not and does exist! wth?

2010-12-17 Thread Adrian Klaver
On Friday 17 December 2010 7:47:44 am Melvin Davidson wrote: PostgreSQL 8.3.11 on i686-redhat-linux-gnu, compiled by GCC gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-46) Linux version 2.6.18-194.26.1.el5 (mockbu...@builder10.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Tue Nov

[GENERAL] Copy From suggestion

2010-12-17 Thread Mark Watson
Hello all, Firstly, I apologise if this is not the correct list for this subject. Lately, I've been working on a data conversion, importing into Postgres using Copy From. The text file I'm copying from is produced from an ancient program and produces either a tab or semi-colon delimited file. One

[GENERAL] DB files, sizes and cleanup

2010-12-17 Thread Gauthier, Dave
Hi: I'm trying to justify disk space for a new linux server they're going to give me for my Postgres instance. When I do a du of the place I installed the older instance on the system that is to be replaced, I see that the vast, vast majorityof the space goes to the contents of the base dir.

Re: [GENERAL] Table both does not and does exist! wth?

2010-12-17 Thread Melvin Davidson
Have you tried a REINDEX on pg_class as superuser? Yes, in fact, I have even done a vacuumdb  -v -a -f The problem is still there Melvin

Re: [GENERAL] Table both does not and does exist! wth?

2010-12-17 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 enf=# DROP TABLE IF EXISTS xtmp_changed_ids; NOTICE: table xtmp_changed_ids does not exist, skipping DROP TABLE enf=# CREATE TABLE xtmp_changed_ids (seq_all SERIAL NOT NULL, ... NOTICE: CREATE TABLE will create implicit sequence...

Re: [GENERAL] Table both does not and does exist! wth?

2010-12-17 Thread Adrian Klaver
On Friday 17 December 2010 8:16:52 am Melvin Davidson wrote: Have you tried a REINDEX on pg_class as superuser? Yes, in fact, I have even done a vacuumdb  -v -a -f The problem is still there Melvin Yea, I believe Greg may have the answer, he has a better eye than I. -- Adrian Klaver

Re: [GENERAL] Table both does not and does exist! wth?

2010-12-17 Thread hubert depesz lubaczewski
On Fri, Dec 17, 2010 at 07:47:44AM -0800, Melvin Davidson wrote: enf=# DROP TABLE IF EXISTS xtmp_changed_ids; NOTICE:  table xtmp_changed_ids does not exist, skipping DROP TABLE enf=# CREATE TABLE xtmp_changed_ids  (   seq_all  SERIAL NOT NULL,   new_id   VARCHAR(200),   id  

Re: [GENERAL] Table both does not and does exist! wth?

2010-12-17 Thread Melvin Davidson
please don't name your constraint using the same name you named your table. DOH! and duh. :) I can't believe I missed the obvious, but that's why it's better to have someone else take a look. Thanks for spotting that.  I've tacked on _pk to the constraint. Fixed! Melvin

Re: [GENERAL] Table both does not and does exist! wth?

2010-12-17 Thread Tom Lane
Greg Sabino Mullane g...@turnstep.com writes: This seems to indicate it's the xtmp_changed_ids INDEX that already exists, not the xtmp_changed_ids TABLE. Oh, of course: he's got this: CREATE TABLE xtmp_changed_ids ... CONSTRAINT xtmp_changed_ids PRIMARY KEY (seq_all) so he's

Re: [GENERAL] DB files, sizes and cleanup

2010-12-17 Thread Bill Moran
In response to Gauthier, Dave dave.gauth...@intel.com: Hi: I'm trying to justify disk space for a new linux server they're going to give me for my Postgres instance. When I do a du of the place I installed the older instance on the system that is to be replaced, I see that the vast,

Re: [GENERAL] DB files, sizes and cleanup

2010-12-17 Thread Gauthier, Dave
When I restart the DB, it reports... LOG: autovacuum launcher started. ps aux | grep postgres yields this... dfg_suse ps aux | grep postgres pgdbadm 22656 0.0 0.0 21296 2616 pts/7S+ Dec16 0:00 /usr/intel/pkgs/postgresql/8.3.4/bin/psql -h fcadsql3.fc.intel.com hsxreuse pgdbadm 9135

Re: [GENERAL] DB files, sizes and cleanup

2010-12-17 Thread Merlin Moncure
On Fri, Dec 17, 2010 at 12:31 PM, Gauthier, Dave dave.gauth...@intel.com wrote: When I restart the DB, it reports... LOG: autovacuum launcher started. ps aux | grep postgres yields this... dfg_suse ps aux | grep postgres pgdbadm 22656  0.0  0.0  21296  2616 pts/7    S+   Dec16   0:00

Re: [GENERAL] DB files, sizes and cleanup

2010-12-17 Thread Gauthier, Dave
max_fsm_pages = 20 max_fsm_relations = 12000 There are 12 DBs with roughly 30 tables+indexes each. There are apparently 2 bad DBs. Both identical in terms of data models (clones with different data). I've pg_dummped one of them to a file, dropped the DB (took a long time as millions of

Re: [GENERAL] DB files, sizes and cleanup

2010-12-17 Thread Tom Lane
Gauthier, Dave dave.gauth...@intel.com writes: ls -1 | wc took a while for the other bad one but eventually came up with exactly 7,949,911 files, so yes, millions. The other one had millions too before I dropped it. Something is clearly wrong. No doubt, but it's impossible to tell what from

[GENERAL] Getting number of affected rows after DELETE FROM

2010-12-17 Thread Raimon Fernandez
Hi, I'm trying to solve what I think must be a real trivial question. When I use psql after every DELETE FROM table WHERE id= I get how many rows were affected, in this case, deleted. Also I've implemented the full FrontEnd/BackEnd Protocol v3 and there after a CommandComplete also I

[GENERAL] Postgres 9.0 Hiding CONTEXT string in Logs

2010-12-17 Thread Alex -
Hi, I occasionally output information from my PL/Perl functions to show a progres or a debug info like this elog(NOTICE, Table some_table analyzed); which generated the NOTICE: Table some_table analyzed however since upgrading to version 9.0 I also get this annoying string CONTEXT: