Re: [ADMIN] get the array content whis the select clause

2007-06-06 Thread De Leeuw Guy
Great !!! Many thanks Kristo, it's just what I need Guy Kristo Kaiv a écrit : > i guess this what you meant: > (not a nice solution though) writing a function that returns the set > would be a better idea > > create table testintarr (iarr int[]); > insert into testintarr values ('5,6,7,8'); > >

Re: [ADMIN] the right time to vacuum database?

2007-06-06 Thread Charles.Hou
On 6 5 , 9 12 , [EMAIL PROTECTED] (Brad Nicholson) wrote: > On Tue, 2007-06-05 at 03:33 -0700, Charles.Hou wrote: > > how can i know that it's the time to vacuumdb? i set the crontab to > > vacuumdb 3 times in one day. because my database size increase from > > 440MB to 460MB in 8 hours. > > Have

Re: [ADMIN] the right time to vacuum database?

2007-06-06 Thread Charles.Hou
On 6 5 , 9 25 , [EMAIL PROTECTED] (Andrew Sullivan) wrote: > On Tue, Jun 05, 2007 at 03:33:09AM -0700, Charles.Hou wrote: > > how can i know that it's the time to vacuumdb? i set the crontab to > > vacuumdb 3 times in one day. because my database size increase from > > 440MB to 460MB in 8 hours.

Re: [ADMIN] the right time to vacuum database?

2007-06-06 Thread Brad Nicholson
On Tue, 2007-06-05 at 16:59 -0700, Charles.Hou wrote: > On 6 5 , 9 12 , [EMAIL PROTECTED] (Brad Nicholson) wrote: > > On Tue, 2007-06-05 at 03:33 -0700, Charles.Hou wrote: > > > how can i know that it's the time to vacuumdb? i set the crontab to > > > vacuumdb 3 times in one day. because my datab

[ADMIN] Change order of table-columns in pg_catalog.pg_attribute.attnum

2007-06-06 Thread Erwin Brandstetter
Hi group! If I want to change the default order of two columns of a table, can I just manipulate the values in pg_catalog.pg_attribute.attnum? I am trying to do this in pg 8.1.9. Works the same in pg 8.2.x I would assume? BEGIN; UPDATE pg_catalog.pg_attribute SET attnum = 4 WHERE attrelid = 12345

Re: [ADMIN] Change order of table-columns in pg_catalog.pg_attribute.attnum

2007-06-06 Thread Alvaro Herrera
Erwin Brandstetter escribió: > Hi group! > > If I want to change the default order of two columns of a table, can I > just manipulate the values in > pg_catalog.pg_attribute.attnum? It works -- as long as the table is empty. -- Alvaro Herrerahttp://www.CommandPro

Re: [ADMIN] Change order of table-columns in pg_catalog.pg_attribute.attnum

2007-06-06 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > Erwin Brandstetter escribió: >> If I want to change the default order of two columns of a table, can I >> just manipulate the values in >> pg_catalog.pg_attribute.attnum? > It works -- as long as the table is empty. And as long as you have no views, fo

Re: [ADMIN] Change order of table-columns in pg_catalog.pg_attribute.attnum

2007-06-06 Thread Erwin Brandstetter
On Jun 6, 4:59 pm, [EMAIL PROTECTED] (Tom Lane) wrote: > Alvaro Herrera <[EMAIL PROTECTED]> writes: > > Erwin Brandstetter escribió: > >> If I want to change the default order of two columns of a table, can I > >> just manipulate the values in > >> pg_catalog.pg_attribute.attnum? > > It works -- as

Re: [ADMIN] Change order of table-columns in pg_catalog.pg_attribute.attnum

2007-06-06 Thread Igor Neyman
More important question would be, why would you want to do this (change columns order)? I can't think of any valid reason for this. Igor Neyman -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Erwin Brandstetter Sent: Wednesday, June 06, 2007 11:22 AM T

Re: [ADMIN] get the array content whis the select clause

2007-06-06 Thread Erwin Brandstetter
On Jun 5, 12:13 pm, [EMAIL PROTECTED] (Kristo Kaiv) wrote: > i guess this what you meant: > (not a nice solution though) writing a function that returns the set > would be a better idea > > create table testintarr (iarr int[]); > insert into testintarr values ('5,6,7,8'); > > test=# select iarr[idx

[ADMIN] 8.2.4 Won't Build 8.1 Functional Indexes

2007-06-06 Thread Chris Hoover
I am testing upgrades to 8.2.4 from 8.1.3 and am having problems with 8.2.4balking at the functional indexes I have created. These indexes exist and work fine in 8.1.3, so why is 8.2.4 rejecting them? Index 1: CREATE INDEX acceptedbilling_to_date_accepted_billing_dt_idx ON acceptedbilling USIN

Re: [ADMIN] the right time to vacuum database?

2007-06-06 Thread Andrew Sullivan
On Tue, Jun 05, 2007 at 05:28:10PM -0700, Charles.Hou wrote: > Client connected: about 100 pc, 1 pc with 1 connection at least, the > max is 4 connections So up to 400 connections? Are they all running transactions? For any length of time? > 194 tables on the database, and some of the tables a

Re: [ADMIN] 8.2.4 Won't Build 8.1 Functional Indexes

2007-06-06 Thread Alvaro Herrera
Chris Hoover escribió: > I am testing upgrades to 8.2.4 from 8.1.3 and am having problems with > 8.2.4balking at the functional indexes I have created. These indexes > exist and > work fine in 8.1.3, so why is 8.2.4 rejecting them? > > Index 1: > CREATE INDEX acceptedbilling_to_date_accepted_bill

[ADMIN] How to tell how long server has been up?

2007-06-06 Thread Chris Hoover
Maybe I'm blind (wouldn't be the first time), but I can't see a way to find out how long postgres has been running. Is there a way to tell this from a query? I am working with some of the stat views and would like to correlate them to how long the server has been running. Thanks, Chris

[ADMIN] troubleshooting "idle in transaction"

2007-06-06 Thread Dan Harris
Greetings.. I'm running 8.0.12 and the system has been very stable for years now with no significant application changes. I am using Apache::Session::Postgres in a web application to store session state. This has really been flawless for us so far, but lately I've caught a few occurrences wh

[ADMIN] reclaiming disk space after major updates

2007-06-06 Thread Dan Harris
Our usage pattern has recently left me with some very bloated database clusters. I have, in the past, scheduled downtime to run VACUUM FULL and tried CLUSTER as well, followed by a REINDEX on all tables. This does work, however the exclusive lock has become a real thorn in my side. As our sys

Re: [ADMIN] How to tell how long server has been up?

2007-06-06 Thread Benjamin Krajmalnik
select pg_postmaster_start_time() From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chris Hoover Sent: Wednesday, June 06, 2007 3:07 PM To: pgsql-admin@postgresql.org Admin Subject: [ADMIN] How to tell how long serve

[ADMIN] copying data into another database ? (replication)

2007-06-06 Thread Raul Retamozo
Hi everyone on the list. I've been trying to get a way to copy a postgresql table or some columns from table into another one, but this new table must be in another databse and, also, could be in another server. I was working on a jdbc app , which run well when the destiny table was in the sa

Re: [ADMIN] 8.2.4 Won't Build 8.1 Functional Indexes

2007-06-06 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > You can't do this because to_date and other functions are not immutable. > 8.2 seems to be more picky about this -- the date conversions of > timestamptz columns are dependent on the current timezone. The reason 8.2 is more picky is that the function is

Re: [ADMIN] troubleshooting "idle in transaction"

2007-06-06 Thread Peter Koczan
Check the pg_locks system view in the pg_catalog schema. It will tell you a wealth of information. Peter Dan Harris wrote: Greetings.. I'm running 8.0.12 and the system has been very stable for years now with no significant application changes. I am using Apache::Session::Postgres in a web

Re: [ADMIN] 8.2.4 Won't Build 8.1 Functional Indexes

2007-06-06 Thread Alvaro Herrera
Tom Lane escribió: > Alvaro Herrera <[EMAIL PROTECTED]> writes: > > You can't do this because to_date and other functions are not immutable. > > 8.2 seems to be more picky about this -- the date conversions of > > timestamptz columns are dependent on the current timezone. > > The reason 8.2 is mor

Re: [ADMIN] 8.2.4 Won't Build 8.1 Functional Indexes

2007-06-06 Thread Chris Hoover
Well, the one index: CREATE INDEX acceptedbilling_to_date_accepted_billing_dt_idx ON acceptedbilling USING btree (to_date(accepted_billing_dt::text, 'mmdd'::text));. Reject: ERROR: functions in index expression must be marked IMMUTABLE SQL state: 42P17 Is actually a date stored in a varch

[ADMIN] Encountering errors while using pg_ctl

2007-06-06 Thread Ali, Luqman
Hi All, We're using postgresql v.8.0.4 on a RHEL ES 4. Its newly installed by my sys-admin and when trying to use pg_ctl I get this error: [EMAIL PROTECTED] pgsql]$ pg_ctl -D /usr/local/pgsql/data stop -l log The programs "postmaster" and "psql" are needed by pg_ctl but were not found in the dire

Re: [ADMIN] Encountering errors while using pg_ctl

2007-06-06 Thread Phillip Smith
> [EMAIL PROTECTED] pgsql]$ pg_ctl -D /usr/local/pgsql/data stop -l log > The programs "postmaster" and "psql" are needed by pg_ctl but > were not found in the directory "/usr/bin". > Check your installation. Where did you install Postgres to? Did you install a binary package or compile from sourc

Re: [ADMIN] Encountering errors while using pg_ctl

2007-06-06 Thread Ali, Luqman
Phillip, As you can see it, > Where did you install Postgres to? Did you install a binary package or > compile from source? Its from a binary source. The files are in various places but $PGDATA will be in /usr/local/pgsql. Someone else did the installation. >You may just need to sym link pos

Re: [ADMIN] Encountering errors while using pg_ctl

2007-06-06 Thread Ali, Luqman
All, I realize what the problem is. Somehow multiple versions on pg_ctl exists... [EMAIL PROTECTED] pgsql]$ find / -name pg_ctl -print 2>/dev/null /usr/bin/pg_ctl /usr/local/pgsql/bin/pg_ctl /opt/postgresql-8.0.4/src/bin/pg_ctl /opt/postgresql-8.0.4/src/bin/pg_ctl/pg_ctl [EMAIL PROTECTED] pgsql]$

Re: [ADMIN] 8.2.4 Won't Build 8.1 Functional Indexes

2007-06-06 Thread Joshua D. Drake
Chris Hoover wrote: Well, the one index: CREATE INDEX acceptedbilling_to_date The second index is rather stupid, it was an early index before I figured out how to split a timestamp. Anyway, is there a way to make the first index work? Otherwise we end up with a seq scan on our billing tabl

[ADMIN] WAL restore

2007-06-06 Thread Jerry Huff
I am having a problem in restoring from WAL files. I have restored from a dump file and trying to step through the WAL files. LOG: starting archive recovery LOG: restore_command = "cp /home/backup/%f "%p"" LOG: restored log file "0001.history" from archive PANIC: syntax error in hist