[GENERAL] make postgresql 9.5 default on centos 7

2017-08-18 Thread Steve Clark
Hi List, I loaded 9.5 on CentOS 7 but by default every thing wants to use the default 9.2 version that comes with CentOS 7. Is there a simple way to fix this so the 9.5 version of tools and libraries are used. Thanks, Steve -- Sent via pgsql-general mailing list

Re: [GENERAL] Schedule

2017-06-20 Thread Steve Clark
On 06/20/2017 10:38 AM, Adrian Klaver wrote: > On 06/20/2017 07:00 AM, Steve Clark wrote: >> On 06/20/2017 09:02 AM, Adrian Klaver wrote: >>> On 06/20/2017 05:35 AM, Steve Clark wrote: >>>> Hello, >>>> >>>> We have customers whose equipment we

Re: [GENERAL] Schedule

2017-06-20 Thread Steve Clark
On 06/20/2017 09:02 AM, Adrian Klaver wrote: > On 06/20/2017 05:35 AM, Steve Clark wrote: >> Hello, >> >> We have customers whose equipment we monitor. Some of the customers don't >> run a 24/7 operation >> and turn their equipment off when the go home. We need

[GENERAL] Schedule

2017-06-20 Thread Steve Clark
Hello, We have customers whose equipment we monitor. Some of the customers don't run a 24/7 operation and turn their equipment off when the go home. We need to create a schedule for them of when we can ignore alerts from their equipment. We use postgresql in our monitoring environment to

Re: [GENERAL] Why so long?

2017-04-19 Thread Steve Clark
On 04/19/2017 11:57 AM, Jeff Janes wrote: > On Wed, Apr 19, 2017 at 8:24 AM, Steve Clark <steve.cl...@netwolves.com > <mailto:steve.cl...@netwolves.com>> wrote: > > Hello, > > I am confused. I have a table that has an incrementing primary key id. > >

Re: [GENERAL] Why so long?

2017-04-19 Thread Steve Clark
Should add this is version 9.4.10 of postgresql On 04/19/2017 11:24 AM, Steve Clark wrote: > Hello, > > I am confused. I have a table that has an incrementing primary key id. > > When I select max(id) from table is returns almost instantly but > when I select min(id) from tab

[GENERAL] Why so long?

2017-04-19 Thread Steve Clark
Hello, I am confused. I have a table that has an incrementing primary key id. When I select max(id) from table is returns almost instantly but when I select min(id) from table it takes longer than I want to wait. Shouldn't postgresql be able to quickly find the minimum id value in the index?

Re: [GENERAL] psql - looking in wrong place for socket

2017-03-17 Thread Steve Clark
On 03/17/2017 10:14 AM, Adrian Klaver wrote: > On 03/17/2017 06:58 AM, Steve Clark wrote: >> On 03/17/2017 09:49 AM, Adrian Klaver wrote: >>> On 03/17/2017 06:42 AM, Steve Clark wrote: >>>> Hi List, >>>> >>>> I am running postgr

Re: [GENERAL] psql - looking in wrong place for socket

2017-03-17 Thread Steve Clark
On 03/17/2017 09:49 AM, Adrian Klaver wrote: > On 03/17/2017 06:42 AM, Steve Clark wrote: >> Hi List, >> >> I am running postgresql 8.4.20 on CentOS 6. Things have been running fine >> for a long time >> then I rebooted. Postgres came up but when I tried to c

[GENERAL] psql - looking in wrong place for socket

2017-03-17 Thread Steve Clark
Hi List, I am running postgresql 8.4.20 on CentOS 6. Things have been running fine for a long time then I rebooted. Postgres came up but when I tried to connect with psql on the local machine I got psql: could not connect to server: No such file or directory Is the server running

[GENERAL] Postgresql 94 from PostgreSQL RPM Repository (with Yum)

2016-11-10 Thread Steve Clark
Hi I installed the following package: postgresql94-server-9.4.9-1PGDG.rhel6.x86_64 postgresql94-plperl-9.4.9-1PGDG.rhel6.x86_64 postgresql94-plpython-9.4.9-1PGDG.rhel6.x86_64 postgresql94-contrib-9.4.9-1PGDG.rhel6.x86_64 postgresql94-devel-9.4.9-1PGDG.rhel6.x86_64

Re: [GENERAL] deadlock error - version 8.4 on CentOS 6

2016-10-28 Thread Steve Clark
On 10/28/2016 10:25 AM, Tom Lane wrote: Steve Clark <steve.cl...@netwolves.com> writes: On 10/28/2016 09:48 AM, Tom Lane wrote: Retrying might be a usable band-aid, but really this is an application logic error. The code that is trying to do "lock table t_unit in exclusive mode&qu

Re: [GENERAL] deadlock error - version 8.4 on CentOS 6

2016-10-28 Thread Steve Clark
On 10/28/2016 09:48 AM, Tom Lane wrote: Steve Clark <steve.cl...@netwolves.com> writes: No. But I examined the pg_log/log_file and saw an error indicating it was autovacuum: 2016-10-27 09:47:02 EDT:srm2api:12968:LOG: sending cancel to blocking autovacuum PID 12874 2016-10-27 09

Re: [GENERAL] deadlock error - version 8.4 on CentOS 6

2016-10-28 Thread Steve Clark
On 10/28/2016 09:15 AM, Adrian Klaver wrote: On 10/28/2016 05:28 AM, Steve Clark wrote: Hello List, I am occasionally seeing the following error: ALERT 3 sqlcode=-400 errmsg=deadlock detected on line 3351 So what exactly is it doing at line 3351? from an application written using ecpg when

[GENERAL] deadlock error - version 8.4 on CentOS 6

2016-10-28 Thread Steve Clark
Hello List, I am occasionally seeing the following error: ALERT 3 sqlcode=-400 errmsg=deadlock detected on line 3351 from an application written using ecpg when trying an update to the table. Can autovacuum be causing this, since no one else is updating this database table. Thanks, --

Re: [GENERAL] dumb question

2016-06-02 Thread Steve Clark
) from sometable where sts=0 -Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Steve Clark Sent: Thursday, June 2, 2016 9:56 AM To: pgsql <pgsql-general@postgresql.org> Subject: [GENERAL] dumb question Hi List, I am

[GENERAL] dumb question

2016-06-02 Thread Steve Clark
Hi List, I am a noob trying to do something that seems like it should be easy but I can't figure it out. I have a table like so: id | ref_id | sts -- 1 || 0 2 | 1 | 1 3 || 0 4 || 0 5 | 4 | 1 6 || 0 7 | 6 | 1 I want

Re: [GENERAL] dumb question

2016-06-02 Thread Steve Clark
Thanks all the below seem to do the trick. On 06/02/2016 01:58 PM, David G. Johnston wrote: select max(id) from yourtable where sts=0 and id not in (select ref_id from yourtable); select max(id) from yourtable where sts=0 and id not in (select ref_id from yourtable); -- Stephen Clark

[GENERAL] dumb question

2016-06-02 Thread Steve Clark
Hi List, I am a noob trying to do something that seems like it should be easy but I can't figure it out. I have a table like so: id | ref_id | sts -- 1 || 0 2 | 1 | 1 3 || 0 4 || 0 5 | 4 | 1 6 || 0 7 | 6 | 1 I want

[GENERAL] Get sum of sums

2016-05-03 Thread Steve Clark
Hi List, I have the following table that has netflow data. I can get the top ten receivers by the query below - but I would also like to get at the same time a grand total of the RX Bytes. I am not exactly sure how to do it. This is with version 8.4. select ip_dst as "Receiver" ,sum(bytes) as

[GENERAL] noobie join question

2015-05-11 Thread Steve Clark
Hi List, I am having trouble trying to figure out how to get the result listed at the bottom. I have 3 tables units, types of units which has a description of the units, and a table that list associations of the units. I can't figure out how to do the proper joins. Any pointers would be

Re: [GENERAL] noobie join question

2015-05-11 Thread Steve Clark
On 05/11/2015 07:16 AM, Oliver Elphick wrote: On Mon, 2015-05-11 at 06:46 -0400, Steve Clark wrote: Hi List, I am having trouble trying to figure out how to get the result listed at the bottom. I have 3 tables units, types of units which has a description of the units, and a table that list

[GENERAL] order by question

2014-08-07 Thread Steve Clark
Hello, I am confused by how postgres 8,4..13 is sorting my data. \d test Table public.test Column | Type | Modifiers +--+--- data | text | select * from test order by data; data -- - -- 1 11 11F 1F a b C F -F Feneric Generic (14 rows) The

Re: [GENERAL] order by question

2014-08-07 Thread Steve Clark
On 08/07/2014 11:36 AM, Kevin Grittner wrote: Steve Clark scl...@netwolves.com wrote: I am confused by how postgres 8,4..13 is sorting my data. select * from test order by data; data -- - -- 1 11 11F 1F a b C F -F Feneric

Re: [GENERAL] Trouble finding libpq on Centos 6.5

2014-05-08 Thread Steve Clark
On 05/08/2014 02:54 AM, Aqz wrote: Hi. I'm not sure if I should write here, or on a Centos mailing list... I have fresh, vanilla Centos 6.5 with postgresql yum repository added. I've successfully installed postgresql93 and postgresql93-libs packages, but still : $ ld -lpq ld: cannot find

[GENERAL] reindexdb

2014-04-29 Thread Steve Clark
Hello, We have a small (2GB) 8.4.20 database. The prior maintainer ran a reindexdb twice a day (originally started with 7.3.x). Can anybody see a reason why we need to continue to do this? Thanks, -- Stephen Clark *NetWolves Managed Services, LLC.* Director of Technology Phone: 813-579-3200

[GENERAL] CentOS 6 and Postgresql 9.3.4 from PGDG

2014-04-14 Thread Steve Clark
Hello, Don't know if this is better asked on the CentOS ML or here, but... CentOS 6 supplies 8.4.20 but I want to use hot standby - the issue is that the PGDG packages don't install into the usual place they are installed in version specific directories, including the data, binaries,

Re: [GENERAL] CentOS 6 and Postgresql 9.3.4 from PGDG

2014-04-14 Thread Steve Clark
On 04/14/2014 09:02 AM, Moshe Jacobson wrote: On Mon, Apr 14, 2014 at 8:24 AM, Steve Clark scl...@netwolves.com mailto:scl...@netwolves.com wrote: CentOS 6 supplies 8.4.20 but I want to use hot standby - the issue is that the PGDG packages don't install into the usual place

[GENERAL] what \ command actually run

2013-08-16 Thread Steve Clark
Hello, I seem to recall seeing somewhere that you can turn on an option that will let you see what the \ command actually run, but googling and doing a quick scan of the docs didn't turn it up. Could someone assist me on this? Thanks, -- Stephen Clark *NetWolves* Director of Technology Phone:

Re: [GENERAL] Deploying PostgreSQL on CentOS with SSD and Hardware RAID

2013-05-10 Thread Steve Clark
On 05/10/2013 12:46 PM, Merlin Moncure wrote: On Fri, May 10, 2013 at 11:34 AM, Evan D. Hoffman evandhoff...@gmail.com wrote: I'd expect to use a RAID controller with either BBU or NVRAM cache to handle that, and that the server itself would be on UPS for a production DB. That said, a standby

[GENERAL] limit based on count(*)

2013-02-22 Thread Steve Clark
Hello List, I have a query that counts how many time an event occurs in our event_log these are grouped by the serial number of the device that created the event. I would like to show only the rows where the number of events exceeds some threshold. simplified query: select serial_no, count(*)

Re: [GENERAL] limit based on count(*)

2013-02-22 Thread Steve Clark
On 02/22/2013 11:14 AM, Russell Keane wrote: select serial_no, count(*) as restarts from event_log where event_mesg ilike 'system sta%' and event_date current_date - 7 group by serial_no having count(*) X order by restarts I think having is the better option. Thanks all, didn't

Re: [GENERAL] noobie question

2013-01-24 Thread Steve Clark
On 01/24/2013 12:36 PM, Jeff Janes wrote: On Thu, Jan 24, 2013 at 8:53 AM, Chris Angelico ros...@gmail.com wrote: On Fri, Jan 25, 2013 at 3:47 AM, Steve Clark scl...@netwolves.com wrote: Say I have a table that has 2 columns like create table foo ( id integer not null, name text

Re: [GENERAL] noobie question

2013-01-24 Thread Steve Clark
On 01/24/2013 01:06 PM, Chris Angelico wrote: On Fri, Jan 25, 2013 at 4:45 AM, Steve Clark scl...@netwolves.com wrote: Thanks All, This is for a few very small tables, less 100 records each, that a user can delete and insert records into based on the id which is displayed in a php generated

Re: [GENERAL] Need help for import of text file

2012-12-16 Thread Steve Clark
On 12/16/2012 01:12 PM, Peter Bex wrote: On Sun, Dec 16, 2012 at 06:48:35PM +0100, Andreas wrote: With sed as startingpoint I figured it out. Those 3 steps make the input files consumable for COPY 1. dos2unix 2. sed -i 's/[ \t]*$//' 3. sed -i 's/ / /g' You can reduce this to one invocation

Re: [GENERAL] Fixing the loss of 'template1'

2012-03-07 Thread Steve Clark
On 03/07/2012 09:43 AM, Marti Raudsepp wrote: On Wed, Mar 7, 2012 at 16:23, Martin Gregoriemar...@gregorie.org wrote: Is it possible to reinstate 'template1' and all its works without reinitialising the database from scratch. It was suggested to me that running initdb might fix it while

Re: [GENERAL] around fields with psql

2012-02-13 Thread Steve Clark
On 02/13/2012 02:13 PM, Merlin Moncure wrote: On Sat, Feb 11, 2012 at 2:03 AM, Jasen Bettsja...@xnet.co.nz wrote: On 2012-02-10, Steve Clarkscl...@netwolves.com wrote: Is there a way with psql to get column output to be data1,data2,...,datan assuming you are trying to be compatible with

[GENERAL] around fields with psql

2012-02-10 Thread Steve Clark
Hello, Is there a way with psql to get column output to be data1,data2,...,datan I tried -F , but that left off the first and last quote. I can't seem to find a way in the man page. Thanks, -- Stephen Clark *NetWolves* Director of Technology Phone: 813-579-3200 Fax: 813-882-0209 Email:

Re: [GENERAL] around fields with psql

2012-02-10 Thread Steve Clark
On 02/10/2012 02:12 PM, Scott Marlowe wrote: On Fri, Feb 10, 2012 at 11:26 AM, Steve Clarkscl...@netwolves.com wrote: Hello, Is there a way with psql to get column output to be data1,data2,...,datan I tried -F , but that left off the first and last quote. I can't seem to find a way in the

[GENERAL] Ideas for query

2011-10-13 Thread Steve Clark
Hello List, I am a not very experienced writing sql and I have a problem I can't readily solve, so I was hoping to get some help from this great list. Here is my problem I have a table that has event data about the status of units in the field. It has many kinds of events one of which has

Re: [GENERAL] Ideas for query

2011-10-13 Thread Steve Clark
On 10/13/2011 08:31 AM, Raymond O'Donnell wrote: On 13/10/2011 12:17, Steve Clark wrote: Hello List, I am a not very experienced writing sql and I have a problem I can't readily solve, so I was hoping to get some help from this great list. Here is my problem I have a table that has event data

[GENERAL] 7.4 quoting

2011-03-31 Thread Steve Clark
Hi List, I am having a problem trying to do the following: ssh postgres@192.168.198.93 'psql -Atc select a.interface, a.source_ip,a.dest_ip from kernel_gre a, ospfd_interface b where a.interface = b.interface and config ilike '%cost 50%'; config.db' bash turns it into this: ssh

Re: [GENERAL] 7.4 quoting

2011-03-31 Thread Steve Clark
On 03/31/2011 02:06 PM, Arjen Nienhuis wrote: On Thu, Mar 31, 2011 at 20:05, Arjen Nienhuisa.g.nienh...@gmail.com wrote: On Thu, Mar 31, 2011 at 18:56, Steve Clarkscl...@netwolves.com wrote: Hi List, I am having a problem trying to do the following: ssh postgres@192.168.198.93 'psql -Atc

[GENERAL] how to vacuum from standalone backend

2010-12-14 Thread Steve Clark
Help! This is postgresql 8.1.3 also the database debug can easily be recreated if I have to drop it but I can't seem to do that either. vacuumdb debug vacuumdb: could not connect to database debug: FATAL: database is not accepting commands to avoid wraparound data loss in database debug

Re: [GENERAL] how to vacuum from standalone backend

2010-12-14 Thread Steve Clark
On 12/14/2010 01:04 PM, Steve Clark wrote: Help! This is postgresql 8.1.3 also the database debug can easily be recreated if I have to drop it but I can't seem to do that either. vacuumdb debug vacuumdb: could not connect to database debug: FATAL: database is not accepting commands

[GENERAL] dotted quad netmask conversion

2010-12-07 Thread Steve Clark
Hello All, I am working with a postgresql database that has two columns. One for an ip address and another for the netmask. Both of these columns are char varying(30). I would like to convert to just one column as inet. Any one know a slick way to convert the dotted quad netmask, E.G.

Re: [GENERAL] dotted quad netmask conversion

2010-12-07 Thread Steve Clark
On 12/07/2010 10:30 AM, Jon Nelson wrote: On Tue, Dec 7, 2010 at 9:17 AM, Steve Clarkscl...@netwolves.com wrote: Hello All, I am working with a postgresql database that has two columns. One for an ip address and another for the netmask. Both of these columns are char varying(30). I would

Re: [GENERAL] dotted quad netmask conversion

2010-12-07 Thread Steve Clark
On 12/07/2010 11:43 AM, Tom Lane wrote: Steve Clarkscl...@netwolves.com writes: Thanks for the response Jon. I should have stated this PG 8.1.x and '' doesn't exist for network functions. I don't think does what you want anyway. It just does a bit AND on the two addresses, it

Re: [GENERAL] identifying local connections

2010-11-15 Thread Steve Clark
On 11/15/2010 11:00 AM, Scott Ribe wrote: On Nov 15, 2010, at 8:50 AM, Tom Lane wrote: netstat will probably work for this, depending on what platform you're on. OS X. I can see the connections, but I don't see an option to display PIDs. netstat -an will do it on linux.

Re: [GENERAL] Linux

2010-11-04 Thread Steve Clark
On 11/04/2010 11:10 AM, Bill Moran wrote: In response to Michael Gouldmgo...@intermodalsoftwaresolutions.net: I know that this is probably a religion issue but we are looking to move Postgres to a Linux server. We currently have a Windows 2008 R2 active directory and all of the other

Re: [GENERAL] 8.4 Data Not Compatible with 9.0.1 Upgrade?

2010-11-02 Thread Steve Clark
On 11/01/2010 02:49 PM, Carlos Mennens wrote: On Mon, Nov 1, 2010 at 2:27 PM, Steve Crawford scrawf...@pinpointresearch.com wrote: I'm guessing you are missing an initdb. Move your old data directory somewhere else for now and do a new initdb so you can start up version 9. When you

Re: [GENERAL] Transposing rows and columns

2010-09-17 Thread Steve Clark
On 09/16/2010 05:26 PM, Aram Fingal wrote: On Sep 16, 2010, at 4:37 PM, John R Pierce wrote: On 09/16/10 10:44 AM, Aram Fingal wrote: I have thought about that but later on, when we do the full sized experiments, there will be too many rows for Excel to handle. if you insist on this

[GENERAL] alter column to inet get error.

2010-09-03 Thread Steve Clark
Hello List, I want to change some columns in a database that were originally created as char varying to inet. When I try I get an error. Is there anyway to work around this? See below for table definition. Table public.kernel_gre Column | Type |

Re: [GENERAL] alter column to inet get error.

2010-09-03 Thread Steve Clark
On 09/03/2010 09:38 AM, A. Kretschmer wrote: In response to Steve Clark : Hello List, I want to change some columns in a database that were originally created as char varying to inet. When I try I get an error. Is there anyway to work around this? See below for table definition

Re: [GENERAL] Feature proposal

2010-08-25 Thread Steve Clark
On 08/25/2010 12:30 PM, Joshua D. Drake wrote: On Wed, 2010-08-25 at 12:20 -0400, Eric Comeau wrote: Without even changing any line of data or code in sql ! Incredible, isn't it ? Curious- what postgresql.conf settings did you change to improve it? The most obvious would be to turn

Re: [GENERAL] PG_DUMP very slow because of STDOUT ??

2010-07-13 Thread Steve Clark
On 07/13/2010 07:29 AM, Andras Fabian wrote: Now, I have found an unorthodox way, to make a slow machine run COPY-to-STDOUT fast. I empty the cache memory of the server, which makes free in free -m jump up to 14 GBytes (well, I just noticed, that most of the memory on the server is in cache

Re: [GENERAL] PG_DUMP very slow because of STDOUT ??

2010-07-13 Thread Steve Clark
On 07/13/2010 10:35 AM, Andras Fabian wrote: Hi Greg, hmmm, thats true. Thos settings for example were much higher too (on the Ubuntu server), than on our old machine. New machine has: - dirty_ratio = 20 (old has 10) - dirty_background_ratio = 10 (old has 5) But obviously setting

Re: [GENERAL] postgreSQL not working after upgrade to Ubuntu 10.4

2010-05-07 Thread Steve Clark
On 05/07/2010 12:10 PM, AllieH wrote: Yesterday I upgraded from Ubuntu 9.10 to 10.4. Unfortunately this has caused me serious problems with everything related to postgreSQL. It seems as though the new version of ubuntu is requiring me to use PostgreSQL 8.4 instead of 8.3 which I was previously

Re: [GENERAL] postgreSQL not working after upgrade to Ubuntu 10.4

2010-05-07 Thread Steve Clark
On 05/07/2010 01:22 PM, Alan Hodgson wrote: On Friday 07 May 2010, AllieHallison.h...@ll.mit.edu wrote: Yesterday I upgraded from Ubuntu 9.10 to 10.4. Unfortunately this has caused me serious problems with everything related to postgreSQL. It seems as though the new version of ubuntu is

Re: [GENERAL] checkpoints/bgwriter tuning verification

2009-10-30 Thread Steve Clark
On 10/29/2009 04:42 PM, Scott Marlowe wrote: On Thu, Oct 29, 2009 at 12:46 PM, Vick Kheravi...@khera.org wrote: On my primary DB I'm observing random slowness which just doesn't make sense to me. The I/O system can easily do 40MB/sec writes, but I'm only seeing a sustained 5MB/sec, even as

Re: [GENERAL] When to use cascading deletes?

2009-06-11 Thread Steve Clark
David wrote: Thanks for the tips, those make sense. I was thinking through this some more after sending my mail, and came to similar conclusions. It would be nice though if this info was more available to people doing research on the subject. Where did you pick up these ideas? At least this

Re: [GENERAL] easy entry forms on a pg database

2009-05-15 Thread Steve Clark
Scott Mead wrote: On Fri, May 15, 2009 at 1:11 PM, Raphael Bauduin rbli...@gmail.com mailto:rbli...@gmail.com wrote: Hi, Are there any tool/libs to easily and rapidly generate web-based entry forms for tables in a postgresql database? I used this once for a quick project:

Re: [GENERAL] recover corrupt DB?

2009-05-01 Thread Steve Clark
Craig Ringer wrote: Peter Eisentraut wrote: On Thursday 23 April 2009 18:30:27 Dan Armbrust wrote: I had a test system (read as not backed up, sigh) which had the disk go full while PostgreSQL was loaded, consequently, PostgreSQL will no longer start. It is logging an error about detecting an

[GENERAL] cast needed - but where and why?

2009-04-02 Thread Steve Clark
Hello list, I am getting the following error after upgrading from 7.4.6 to 8.3.6 and can't figure out what is wrong. Any help would be greatly appreciated. from our program: sqlcode=-400 errmsg='column event_ref_log_no is of type integer but expression is of type text' in line 4138. from

Re: [GENERAL] cast needed - but where and why?

2009-04-02 Thread Steve Clark
Tom Lane wrote: Steve Clark scl...@netwolves.com writes: I am getting the following error after upgrading from 7.4.6 to 8.3.6 and can't figure out what is wrong. Any help would be greatly appreciated. 2009-04-02 10:45:10 EDT:srm2api:ERROR: column event_ref_log_no is of type integer

[GENERAL] 8.3.x log maintenance

2008-10-27 Thread Steve Clark
Hi, I have postgres logging into data/pg_log/ which works great. My question is there and option that tells postgres to only keep the last n log files? Or does someone have a script that be run daily to remove the older log files so that I only end up with n log files? Thanks, Steve

Re: [GENERAL] 8.3.x log maintenance

2008-10-27 Thread Steve Clark
Tom Lane wrote: Steve Clark [EMAIL PROTECTED] writes: I have postgres logging into data/pg_log/ which works great. My question is there and option that tells postgres to only keep the last n log files? The usual solution is to choose a filename pattern that will repeat after an appropriate

Re: [GENERAL] setting Postgres client

2008-09-19 Thread Steve Clark
Markova, Nina wrote: Thanks Richard. I specified the host IP ( I use the default 5432 port), got error: psql: could not connect to server: Connection refused Is the server running on host 192.168.XX.XXX and accepting TCP/IP connections on port 5432? The only tcp lines in my

Re: [GENERAL] Backend timeout

2008-09-18 Thread Steve Clark
Scott Marlowe wrote: On Tue, Sep 16, 2008 at 7:21 AM, Dragan Ciric [EMAIL PROTECTED] wrote: Hi! We need some help. Sometimes we have broken connections with backend ( postgresql server ). When this occurs, we have idle in transaction indication on server side. Can you answer us, how long

Re: [GENERAL] MERGE: performance advices

2008-09-02 Thread Steve Clark
Richard Broersma wrote: On Tue, Sep 2, 2008 at 4:19 AM, Ivan Sergio Borgonovo [EMAIL PROTECTED] wrote: insert into d (pk, c1, c2, ...) select pk, c1, c2, c3 from s where s.pk not in (select pk from d); This insert statement might be faster: INSERT INTO d (pk, c1, c2, ... ) SELECT pk, c1,

Re: [GENERAL] MERGE: performance advices

2008-09-02 Thread Steve Clark
Richard Broersma wrote: On Tue, Sep 2, 2008 at 8:10 AM, Steve Clark [EMAIL PROTECTED] wrote: Is there a way to do something similar with the following? I am an SQL noob and the following takes longer to run than is reasonable, on the order of hours. insert into myevents select * from

Re: [GENERAL] MERGE: performance advices

2008-09-02 Thread Steve Clark
Richard Broersma wrote: On Tue, Sep 2, 2008 at 9:47 AM, Steve Clark [EMAIL PROTECTED] wrote: srm2=# explain srm2-# INSERT INTO Myevents srm2-# SELECT * ERROR: INSERT has more expressions than target columns srm2=# explain srm2-# INSERT INTO Myevents srm2-# SELECT * ERROR

Re: [GENERAL] MERGE: performance advices

2008-09-02 Thread Steve Clark
Tom Lane wrote: Richard Broersma [EMAIL PROTECTED] writes: There is one possible alteration that may or many not improve performance. This would be to replace the EXISTS with a LEFT JOIN WHERE IS NOT NULL; That changes the behavior, doesn't it? Or is event_log_no a unique key for

Re: [GENERAL] 8.3.1 query plan

2008-08-29 Thread Steve Clark
Tom Lane wrote: Steve Clark [EMAIL PROTECTED] writes: Tom Lane wrote: Consider testing the conditions on A at the top level, instead of redundantly checking them inside the sub-query on B. Thanks for the response Tom, I am a SQL neophyte, so I'll try to rework the query. What I meant

Re: [GENERAL] 8.3.1 query plan

2008-08-28 Thread Steve Clark
Tom Lane wrote: Steve Clark [EMAIL PROTECTED] writes: explain insert into myevents select * from t_unit_event_log a where exists (select b.event_log_no from myevents b where a.event_status = 1 and a.event_ref_log_no IS NOT NULL and a.event_ref_log_no

[GENERAL] 8.3.1 query plan

2008-08-27 Thread Steve Clark
Hello List, I have inherited an existing application. It has a table of events and some events may reference an earlier event. We have a script that saves the first N number of events for each device, but we also want to save any additional event that is referenced by one of the first N

Re: [GENERAL] 8.3.1 query plan

2008-08-27 Thread Steve Clark
Martijn van Oosterhout wrote: On Wed, Aug 27, 2008 at 11:00:54AM -0400, Steve Clark wrote: So I did an explain and I see it is doing a seq scan in the last sub plan - there are about 375,000 rows in myevent - why isn't it using the index instead of doing a seq scan? create unique index

[GENERAL] default postgresql.conf

2008-08-19 Thread Steve Clark
Hello List, When an initdb is done where do the default postgresql.conf and pg_hba.conf come from? Are they copied from some template file? Thanks, Steve -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

Re: [GENERAL] renumber table

2008-06-20 Thread Steve Clark
need to set its nextval. Dave On Thu, Jun 19, 2008 at 7:54 AM, Steve Clark [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Scott Marlowe wrote: On Wed, Jun 18, 2008 at 3:50 PM, Steve Clark [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote

Re: [GENERAL] renumber table

2008-06-19 Thread Steve Clark
Scott Marlowe wrote: On Wed, Jun 18, 2008 at 3:50 PM, Steve Clark [EMAIL PROTECTED] wrote: I realize this is certainly not the best design - but at this point in time it can't be changed. The table is rarely updated and never concurrently and is very small, typically less than 100 rows so

[GENERAL] renumber table

2008-06-18 Thread Steve Clark
Hello List, I have acquired the task of maintaining and existing application that uses postgresql. I am only lightly versed in sql and have the following problem I need to solve. I have a table in which each row has a column - row_number. The row_numbers need to be sequential. Everything is

Re: [GENERAL] renumber table

2008-06-18 Thread Steve Clark
Scott Marlowe wrote: On Wed, Jun 18, 2008 at 2:58 PM, Steve Clark [EMAIL PROTECTED] wrote: Hello List, I have acquired the task of maintaining and existing application that uses postgresql. I am only lightly versed in sql and have the following problem I need to solve. I have a table

Re: [GENERAL] --enable-thread-safety bug

2008-03-23 Thread Steve Clark
Craig Ringer wrote: Steve Clark wrote: I guess the real question is why we are running out of memory when this option is enabled. Since my app doesn't use threads that points to a memory leak in the ecpg library when enable thread safety is turned on. It might be worth building ecpg

Re: [GENERAL] --enable-thread-safety bug

2008-03-23 Thread Steve Clark
Michael Meskes wrote: On Sat, Mar 22, 2008 at 04:58:28PM -0400, Steve Clark wrote: Not exactly sure what you are asking about - descriptors and auto allocating. So I guess you don't use either feature. :-) The program processes about 80 packets a day, which can update several

Re: [GENERAL] --enable-thread-safety bug

2008-03-22 Thread Steve Clark
Tom Lane wrote: Steve Clark [EMAIL PROTECTED] writes: The return from malloc should be checked to make sure it succeeds - right??? Probably, but what do you expect the code to do if it doesn't succeed? This function seems not to have any defined error-return convention

Re: [GENERAL] --enable-thread-safety bug

2008-03-22 Thread Steve Clark
Tom Lane wrote: Martijn van Oosterhout [EMAIL PROTECTED] writes: Note this is your in application, not the server. Only your program died. Ofcourse the transaction got aborted, since the client (you) disconnected. There is no way for this to write to the server log, since it may be one another

Re: [GENERAL] --enable-thread-safety bug

2008-03-22 Thread Steve Clark
Martijn van Oosterhout wrote: On Sat, Mar 22, 2008 at 11:28:24AM -0400, Steve Clark wrote: Retry - the malloc - maybe there is a memory leak when --enable-thread-saftey is enabled, send an out of memory message to the postgres log, abort the transaction - I don't know I am not a postgres

Re: [GENERAL] --enable-thread-safety bug

2008-03-22 Thread Steve Clark
Michael Meskes wrote: On Sat, Mar 22, 2008 at 12:51:30PM -0400, Steve Clark wrote: My program had no threads - as I pointed out if I change the default Makefile in the FreeBSD ports system to not enable thread safety my programs runs just fine for days on end. It appears to me without any

Re: [GENERAL] --enable-thread-safety bug

2008-03-22 Thread Steve Clark
Steve Clark wrote: Michael Meskes wrote: On Sat, Mar 22, 2008 at 12:51:30PM -0400, Steve Clark wrote: My program had no threads - as I pointed out if I change the default Makefile in the FreeBSD ports system to not enable thread safety my programs runs just fine for days on end

Re: [GENERAL] cast problem 8.3.1

2008-03-21 Thread Steve Clark
Charles Simard wrote: snip | | postgres error log: | ERROR: operator does not exist: text = integer | HINT: No operator matches the given name and argument type(s). You | might need to add explicit type casts. | STATEMENT: update T_MON_DEVICE_STATUS set device_ip = $1 :: inet | ,

[GENERAL] ecpg program getting stuck

2008-03-21 Thread Steve Clark
Hello List I have a program that worked fine in 7.4.19. I am in process of upgrading to 8.3.1 and my program runs for a while and then hangs. I used gdb to attach to the process and it shows the following backtrace which shows it going into the libpq library and getting stuck. Anybody have any

Re: [GENERAL] ecpg program getting stuck

2008-03-21 Thread Steve Clark
Tom Lane wrote: Steve Clark [EMAIL PROTECTED] writes: I have a program that worked fine in 7.4.19. I am in process of upgrading to 8.3.1 and my program runs for a while and then hangs. I used gdb to attach to the process and it shows the following backtrace which shows it going

[GENERAL] --enable-thread-safety bug

2008-03-21 Thread Steve Clark
Hello List, I am running 8.3.1 on FreeBSD 6.2 patch-7. The ports for Freebsd turn on --enable-thread-safety during configure of pg. When running my app after some time I have been getting a core dump - sig 11. #0 0x28333b96 in memcpy () from /lib/libc.so.6 (gdb) bt #0 0x28333b96 in

[GENERAL] cast problem 8.3.1

2008-03-20 Thread Steve Clark
Hello List, I can't seem to figure out what is this code that worked on 7.4.x. I've added cast to everything but still get: postgres error log: ERROR: operator does not exist: text = integer HINT: No operator matches the given name and argument type(s). You might need to add explicit type

Re: [GENERAL] ecpg problem

2008-03-03 Thread Steve Clark
Michael Meskes wrote: On Fri, Feb 29, 2008 at 11:27:25AM -0500, Steve Clark wrote: Actually it appears to work in 8.2.5 but be broken in 8.2.6 and 8.3.0. Are you really sure? It appears to me that there was no change between 8.2.5 and 8.2.6 that could affect ecpg's handling of arrays

Re: [GENERAL] ecpg problem

2008-03-03 Thread Steve Clark
Michael Meskes wrote: I just committed the attached small fix to CVS HEAD and the 8.3 branch. This should fix your problem. Michael diff --exclude CVS -ru /home/postgres/pgsql-ecpg/preproc/type.c preproc/type.c ---

Re: [GENERAL] ecpg problem

2008-02-29 Thread Steve Clark
Steve Clark wrote: Hello List, Don't know whether anyone here can help but... We have some code that has compiled and ran just fine from postgresql 7.3.x thru 8.2.6. It uses embedded sql. I just yesterday upgraded our test system to 8.3.0 and this code will no longer compile. Below

[GENERAL] ecpg problem

2008-02-29 Thread Steve Clark
Hello List, Don't know whether anyone here can help but... We have some code that has compiled and ran just fine from postgresql 7.3.x thru 8.2.6. It uses embedded sql. I just yesterday upgraded our test system to 8.3.0 and this code will no longer compile. Below is a standalone code fragment

[GENERAL] warm standby examples.

2008-01-31 Thread Steve Clark
Hello List, I am going to be setting up a warm standby postgresql 8.2.5 high availability 2 server system. I was wondering if anybody that has done this can share some scripts, pertinent postgresql.conf entries, etc so I don't have to reinvent the wheel. I have read the manual a couple of

Re: [GENERAL] warm standby examples.

2008-01-31 Thread Steve Clark
Erik Jones wrote: On Jan 31, 2008, at 10:04 AM, Steve Clark wrote: Hello List, I am going to be setting up a warm standby postgresql 8.2.5 high availability 2 server system. I was wondering if anybody that has done this can share some scripts, pertinent postgresql.conf entries, etc so I

  1   2   >