Re: [GENERAL] Postgres 8.4: archive_timeout vs. checkpoint_timeout

2011-10-07 Thread Derrick Rice
On Thu, Oct 6, 2011 at 3:47 AM, Frank Lanitz wrote: > Hi folks, > > I want to refer to a question Rob did back in 2008 at > http://archives.postgresql.org/pgsql-general/2008-07/msg01167.php as we > are currently running into a similar question: > We are using warm standby via PITR using a shared

Re: [GENERAL] { SELECT *->NOT(column1, column2) FROM table } syntax idea

2011-06-15 Thread Derrick Rice
On Wed, Jun 15, 2011 at 6:08 PM, David Johnston wrote: > The main reason to avoid doing so is to allow for a view to output all > the columns of the underlying tables. If I drop/create the view after > altering the underlying tables the new view will have the additional columns > without any d

Re: [GENERAL] invalid byte sequence for encoding "UTF8"

2011-06-02 Thread Derrick Rice
That specific character sequence is a result of Unicode implementations prior to 6.0 mixing with later implementations. See here: http://en.wikipedia.org/wiki/Specials_%28Unicode_block%29#Replacement_character You could replace that sequence with the correct 0xFFFD sequence with `sed` for exampl

Re: [GENERAL] Shared Buffer Size

2011-05-27 Thread Derrick Rice
Check out the "Inside the PostgreSQL Buffer Cache" link here: http://projects.2ndquadrant.com/talks Thanks to Greg Smith (active here). Derrick On Fri, May 27, 2011 at 3:36 PM, preetika tyagi wrote: > Hi All, > > I am little confused about the internal working of PostgreSQL. There is a > param

[GENERAL] Migrating to a WAL-shipped replication cluster

2011-05-13 Thread Derrick Rice
Happy Friday, I'm migrating a set of data, about 16G of SQL-dump (-F plain), to a postgresql instance with WAL shipping backups. My plan is to do this in subsets of data, as there some work that has to be done with the dump before it is moved over. Let's assume 8 chunks ranging from 1G to 4G in

Re: [GENERAL] What could keep a connection / query alive?

2011-03-29 Thread Derrick Rice
On Tue, Mar 29, 2011 at 2:54 PM, Derrick Rice wrote: > >> Try trussing the backend process. You may find it in a network IO wait >> trying to send data to a client that is hung or over a socket that was >> timed out by a firewall or network equipment. >> >>

Re: [GENERAL] What could keep a connection / query alive?

2011-03-29 Thread Derrick Rice
On Tue, Mar 29, 2011 at 3:17 AM, Jerry Sievers wrote: > > > What can cause this?? Why would these tcp and statement timeout settings > not terminate the backend? > > Try trussing the backend process. You may find it in a network IO wait > trying to send data to a client that is hung or over a soc

[GENERAL] What could keep a connection / query alive?

2011-03-28 Thread Derrick Rice
Hi folks, I'm investigating (using 8.2) an instance of a database client connection remaining open in a single query well past statement timeout settings. I understand that severed TCP connections can cause the backend to hang until the connection is closed, but our tcp keepalive settings should

Re: [GENERAL] Primary key vs unique index

2011-03-21 Thread Derrick Rice
On Fri, Mar 18, 2011 at 8:38 AM, Voils, Steven M wrote: > What are the general guidelines under which autovacuum will trigger? I was > unaware it was turned on by default for the newer versions. Would it be > worthwhile to leave the manual vacuuming on? Currently it runs immediately > after lar

Re: [GENERAL] Tracking table modifications / table stats

2011-03-03 Thread Derrick Rice
On Thu, Mar 3, 2011 at 12:34 PM, Andy Colson wrote:There are stat tables you can look at: > > http://www.postgresql.org/docs/9.0/static/monitoring-stats.html > > -Andy > Aha! Thank you.

[GENERAL] Tracking table modifications / table stats

2011-03-03 Thread Derrick Rice
Hey folks, I was looking through the contrib modules with 8.4 and hoping to find something that satisfies my itch. http://www.postgresql.org/docs/8.4/static/pgstatstatements.html comes the closest. I'm inheriting a database which has mostly unknown usage patterns, and would like to figure them ou

Re: [GENERAL] Speeding up index scans by truncating timestamp?

2011-02-15 Thread Derrick Rice
out as much of it on my own as I could, rather than just get the end-result of an expert's answer without all the knowledge of the leg work. Thank you, though. On Tue, Feb 15, 2011 at 10:20 AM, Vick Khera wrote: > On Tue, Feb 15, 2011 at 10:00 AM, Derrick Rice > wrote: > > Is th

Re: [GENERAL] Speeding up index scans by truncating timestamp?

2011-02-15 Thread Derrick Rice
> > Would creating an index on the timestamp truncated to the *day* make the > index more efficient for queries which are interested in events falling in a > range of 7+ days? > I gave this a shot, changing the index to be on date_trunc('day', timestamp). PostgreSQL (8.2) then decided not to use

[GENERAL] Speeding up index scans by truncating timestamp?

2011-02-14 Thread Derrick Rice
Hey folks, I've got a table of historical events that 10 million rows over 18+ months. Currently there is an index for the event timestamp. I'm wondering if someone can respond to my curiosity regarding the performance of indexes (BTree). Would creating an index on the timestamp truncated to the

Re: [GENERAL] RESET ROLE and search_path, Connection pool

2010-12-03 Thread Derrick Rice
On Fri, Dec 3, 2010 at 5:13 AM, Marc Mamin wrote: > Hello, > > We are thinking about using a (java based) connection pool. > An issue is that there are many different users to connect. > My idea is to only have superuser connections in the pool > and change the connection role (with SET ROLE) eac

Re: [GENERAL] alter table add column - specify where the column will go?

2010-11-24 Thread Derrick Rice
On Wed, Nov 24, 2010 at 4:43 AM, Thomas Kellerer wrote: > Grzegorz Jaƛkiewicz, 24.11.2010 10:37: > > just never use SELECT *, but always call columns by names. You'll >> avoid having to depend on the order of columns, which is never >> guaranteed, even if the table on disk is one order, the retu

Re: [GENERAL] Survey on backing up unlogged tables: help us with PostgreSQL development!

2010-11-17 Thread Derrick Rice
On Wed, Nov 17, 2010 at 8:20 AM, Yeb Havinga wrote: > That sounds an awful lot like temporary tables. A lot like a GLOBAL temporary table, which isn't currently supported. Is there a difference between a global temporary table (if such a thing existed in PostgreSQL) and an unlogged table? Der

Re: [GENERAL] Survey on backing up unlogged tables: help us with PostgreSQL development!

2010-11-16 Thread Derrick Rice
On Tue, Nov 16, 2010 at 5:46 PM, Josh Berkus wrote: > > Survey is here: > > https://spreadsheets.google.com/ccc?key=0AoeuP3g2YZsFdDFnT2VKNC1FQ0pQNmJGS2dWMTNYMEE&hl=en&authkey=CISbwuYD This is a link to a read-only spreadsheet for me. Derrick

Re: [GENERAL] escape character for 'psql -c ' command

2010-11-16 Thread Derrick Rice
Please include the list when replying. On Tue, Nov 16, 2010 at 11:45 AM, Gary Fu wrote: > Short answer: for simple commands, you can use shell-escaping of a >> double-quoted string. >> >> psql -c "\\copy \"Table\" from 'text file'" >> >> > This works on sh, but I tried this syntax on tcsh, it fa

Re: [GENERAL] escape character for 'psql -c ' command

2010-11-15 Thread Derrick Rice
Short answer: for simple commands, you can use shell-escaping of a double-quoted string. psql -c "\\copy \"Table\" from 'text file'" Note: double \\ is intentional. You need to escape the backslash, which normally escapes other special characters, like $ and ". Watch out for other special charact

Re: [GENERAL] Warm Standby and resetting the primary as a standby

2010-08-23 Thread Derrick Rice
On Mon, Aug 23, 2010 at 5:45 PM, Bruce Momjian wrote: > > > Sorry, I don't know. I think the timelines are only there for safety if > you have to fall back to the previous timeline, and to prevent timeline > mixing. Thanks for the helpful answers. Two follow up questions which, if they can be

Re: [GENERAL] Warm Standby and resetting the primary as a standby

2010-08-19 Thread Derrick Rice
On Wed, Aug 18, 2010 at 9:48 AM, Derrick Rice wrote: > I've been reading up on the documentation for WAL shipping and warm standby > configuration. One concern that I have (a common one, I'm sure) is that it > seems that after bringing a standby server up as primary, othe

[GENERAL] Warm Standby and resetting the primary as a standby

2010-08-18 Thread Derrick Rice
I've been reading up on the documentation for WAL shipping and warm standby configuration. One concern that I have (a common one, I'm sure) is that it seems that after bringing a standby server up as primary, other standby servers (including the original primary) need to be rebased before they can

Re: [GENERAL] select a list of column values directly into an array

2010-07-30 Thread Derrick Rice
On Tue, Jul 27, 2010 at 9:33 AM, Gauthier, Dave wrote: > The select array (select col1 from foo ); ...did it. > > Thanks! > > -Original Message- > From: Merlin Moncure [mailto:mmonc...@gmail.com] > Sent: Tuesday, July 27, 2010 9:25 AM > To: Gauthier, Dave > Cc: pgsql-general@postgresq

Re: [GENERAL] select a list of column values directly into an array

2010-07-30 Thread Derrick Rice
Is it possible to use the ARRAY(select ...) syntax as a substitute for array_agg on versions of postgresql that don't have it? (8.2) It works simply enough when only selecting a single column, but if I need to group by some other column, I'm not clear how I'd go about doing that. For example, wri

[GENERAL] Are identical subqueries in unioned statements nonrepeatable?

2010-07-22 Thread Derrick Rice
Hi all. I had no luck finding a previous message or documentation related to the effective transaction isolation of subqueries, specifically identical subqueries in union statements. Consider the following statement executed without a transaction. select true as from_one, table_one.* from table_