Re: [GENERAL] Restore/dump from /usr/local/pgsql/data directory

2010-09-26 Thread Yaroslav Tykhiy
On 25/09/2010, at 1:11 AM, Craig Ringer wrote: On 24/09/2010 8:40 PM, Raymond O'Donnell wrote: On 24/09/2010 13:21, kongs...@stud.ntnu.no wrote: What version of PG was it? The PG_VERSION file = 8.3 OK, well at least it's not an ancient version that's not available any more. :-) As

Re: [GENERAL] Query plan choice issue

2010-09-20 Thread Yaroslav Tykhiy
On 14/09/2010, at 10:37 AM, Yaroslav Tykhiy wrote: On 14/09/2010, at 12:41 AM, Tom Lane wrote: Yaroslav Tykhiy y...@barnet.com.au writes: [...] I think the major problem you're having is that the planner is completely clueless about the selectivity of the condition substring

Re: [GENERAL] Query plan choice issue

2010-09-13 Thread Yaroslav Tykhiy
Hi Martin, Thank you for your response! On 13/09/2010, at 10:49 AM, Martin Gainty wrote: a cursory look of the plan details a FTS on dbmail_headername invoked by the JOIN clause JOIN dbmail_headername n ON v.headername_id=n.id you would accelerate the seek appreciably by placing indexes on

Re: [GENERAL] Schema search path

2010-09-13 Thread Yaroslav Tykhiy
On 14/09/2010, at 8:56 AM, Tom Lane wrote: Bruce Momjian br...@momjian.us writes: Yaroslav Tykhiy wrote: SELECT * FROM foo.bar WHERE bar.a=1; ^^^ this means foo.bar Do you think it's a feature or a bug? :-) Feature, and SQL-standard behavior. It might

Re: [GENERAL] Query plan choice issue

2010-09-13 Thread Yaroslav Tykhiy
Hi Tom, On 14/09/2010, at 12:41 AM, Tom Lane wrote: Yaroslav Tykhiy y...@barnet.com.au writes: - Bitmap Heap Scan on dbmail_headervalue v (cost=1409.82..221813.70 rows=2805 width=16) (actual time=28543.411..28623.623 rows=1 loops=1) Recheck

[GENERAL] Query plan choice issue

2010-09-12 Thread Yaroslav Tykhiy
Hi all, I'm seeing a funny behaviour in Postgresql 8.4.4. Namely, a query can be executed using either of two different query plans, one taking a few milliseconds and the other, tens of seconds. The work_mem setting doesn't seem to affect it -- tried to increase or decrease it by 2 or

[GENERAL] Schema search path

2010-09-12 Thread Yaroslav Tykhiy
Hi there, Sorry but I've got yet another issue to discuss today, this time that on schema search path. In fact it may not be a bug, but it may be worth a note in the documentation. It seems that if the table in SELECT FROM has an explicit schema specifier, further references to the same

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

2010-08-22 Thread Yaroslav Tykhiy
On Sat, Aug 21, 2010 at 12:45:44PM -0400, Bruce Momjian wrote: 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,

Re: [GENERAL] Warm Standby Weirdness

2010-08-22 Thread Yaroslav Tykhiy
On Thu, Aug 19, 2010 at 11:22:15PM -0400, Tom Lane wrote: Sam Nelson s...@consistentstate.com writes: Here's the output from pg_controldata: $ pg_controldata `pwd` WARNING: Calculated CRC checksum does not match value stored in file. Either the file is corrupt, or it has a different

Re: [GENERAL] High Availability with Postgres

2010-06-20 Thread Yaroslav Tykhiy
Hi, On 21/06/2010, at 3:37 AM, Raymond O'Donnell wrote: On 20/06/2010 17:34, Elior Soliman wrote: Hello, My company looking for some solution for High availability with Postgres. There's quite a bit of information in the documentation here:

Re: [GENERAL] Reversing flow of WAL shipping

2009-10-22 Thread Yaroslav Tykhiy
Hi David, On 22/10/2009, at 2:52 PM, David Jantzen wrote: I want to run a warm standby scenario by you. I'm pretty sure it'll work, but it's a very large database so even the slightest mistake can mean a major setback. Scenario: Server A is the provider node, shipping WAL files to Server B.

Re: [GENERAL] adding another node to our pitr config

2009-10-15 Thread Yaroslav Tykhiy
On 06/10/2009, at 11:51 PM, Geoffrey wrote: We are currently using WAL shipping to have a hot spare of our databases. We want to add another node to this configuration. The question is, what is the best way to go about this? Currently, our script checks to see if the WAL file already

Re: [GENERAL] where clauses and multiple tables

2009-09-08 Thread Yaroslav Tykhiy
On 09/09/2009, at 9:02 AM, David W Noon wrote: On Tue, 8 Sep 2009 14:25:20 -0700, Scott Frankel wrote about [GENERAL] where clauses and multiple tables: Is it possible to join tables in the where clause of a statement? [snip] Given a statement as follows: SELECT foo.foo_id, foo.name FROM

Re: [GENERAL] Can I Save images in postgres?

2009-09-08 Thread Yaroslav Tykhiy
On 09/09/2009, at 10:43 AM, John R Pierce wrote: 纪晓曦 wrote: Can I save images in the postgres? How to define? Does the format matters? Can I save JPG/PNG?How? you can save images as BYTEA data, and the format is totally up to your application, as postgres just treats it as a block of

Re: [GENERAL] [Skytools-users] WAL Shipping + checkpoint

2009-08-31 Thread Yaroslav Tykhiy
On 31/08/2009, at 6:16 PM, Sébastien Lardière wrote: On 28/08/2009 18:14, Simon Riggs wrote: On Fri, 2009-08-28 at 17:54 +0200, Sébastien Lardière wrote: Since this moment, the slave didn't make any checkpoint. Now, we know why. Thanks a lot ! But how can i fix it ? Current issue:

Re: [GENERAL] Could not open relation XXX: No such file or directory

2009-08-20 Thread Yaroslav Tykhiy
Hi there, On 19/08/2009, at 8:38 PM, Craig Ringer wrote: On 19/08/2009 6:26 PM, Alan Millington wrote: 2009-08-19 03:06:45 ERROR: could not read block 0 of relation 1663/52752/52896: No such file or directory Clearly something is amiss, but I don't know what. I should be grateful for

Re: R: [GENERAL] Field's position in Table

2009-08-20 Thread Yaroslav Tykhiy
On 20/08/2009, at 7:24 PM, vinny wrote: I can't really think of any real reason to put the field at a particular position, applications don't reallty care about the order of fields. ... unless an application is brain-damaged by its using a wildcard select, which is a well-known no-no even

Re: [GENERAL] Could not open relation XXX: No such file or directory

2009-08-20 Thread Yaroslav Tykhiy
On 21/08/2009, at 12:40 PM, Seth Gordon wrote: Yaroslav Tykhiy wrote: By the way, `chkdsk' in Windows or `fsck' in Unix can, in a way, be a _source_ of file loss if the file metadata got damaged badly, e.g., by a system crash, and the file node has to be cleared. So I've always been

Re: [GENERAL] Failover, Wal Logging, and Multiple Spares

2009-08-17 Thread Yaroslav Tykhiy
On 18/08/2009, at 9:36 AM, Bryan Murphy wrote: Ok, I've asked this a few times, but nobody ever responded. I think I finally got it though, could somebody confirm my logic? Basically, you setup a chain of servers, and when fails you replicate to the next link in the chain, like so:

Re: [GENERAL] ZFS prefetch considered evil?

2009-07-08 Thread Yaroslav Tykhiy
On 08/07/2009, at 8:39 PM, Alban Hertroys wrote: On Jul 8, 2009, at 2:50 AM, Yaroslav Tykhiy wrote: Hi All, I have a mid-size database (~300G) used as an email store and running on a FreeBSD + ZFS combo. Its PG_DATA is on ZFS whilst xlog goes to a different FFS disk. ZFS prefetch

[GENERAL] ZFS prefetch considered evil?

2009-07-07 Thread Yaroslav Tykhiy
Hi All, I have a mid-size database (~300G) used as an email store and running on a FreeBSD + ZFS combo. Its PG_DATA is on ZFS whilst xlog goes to a different FFS disk. ZFS prefetch was enabled by default and disk time on PG_DATA was near 100% all the time with transfer rates heavily

Re: [GENERAL] How to store text files in the postgresql?

2009-06-12 Thread Yaroslav Tykhiy
DimitryASuplatov wrote: My task is to store a lot (10^5) of small ( 10 MB) text files in the database with the ability to restore them back to the hard drive on demand. I cannot but ask the community a related question here: Can such design, that is, storing quite large objects of varying

Re: [GENERAL] Move PGdata to a different drive

2009-06-08 Thread Yaroslav Tykhiy
David Fetter wrote: On Thu, Jun 04, 2009 at 11:11:29AM -0400, Bruce Momjian wrote: Jennifer Trey wrote: Hi, What file should I be working with? Just shut down the server and move the directory whever you want and restart the server. There are no file contents that need changing. Of course

[GENERAL] Warm standby: 1 to N

2009-05-13 Thread Yaroslav Tykhiy
Hi All, Let's consider the following case: WAL segments from a master have been shipped to N warm standby servers, and now the master fails. Using this or that mechanism, one of the warm standbys takes over and becomes the new master. Now the question is what to do with the other N-1 warm