[GENERAL] serious issue with age(relfrozenxid)::int.

2014-07-20 Thread Prabhjot Sheena
Hi all Most of my tables in postgresql database 8.3 is showing up this. Pls suggest me what should be done with this and if this is something really serious caesius=# select relname, age(relfrozenxid)::int from pg_class order by 2 desc ; relname

Re: [GENERAL] serious issue with age(relfrozenxid)::int.

2014-07-20 Thread John R Pierce
On 7/20/2014 12:29 AM, Prabhjot Sheena wrote: Most of my tables in postgresql database 8.3 is showing up this. Pls suggest me what should be done with this and if this is something really serious why are you casting age() to an int ? -- john r pierce

Re: [GENERAL] Rank and Partition

2014-07-20 Thread Alban Hertroys
On 20 Jul 2014, at 5:38, mapl...@light42.com wrote: Assume I have a table of all schools in the US, and another with all museums, and I want to see all museums that are within some distance of each school, by school. (yes this is spatial but the distance is just a function call - no mystery

[GENERAL] check database integrity

2014-07-20 Thread Torsten Förtsch
Hi, we are using 9.3 with data checksums enabled. Now I am looking for a way to check if all database blocks are still intact. First I tried pg_filedump. In many cases it simply ignored tampered data blocks. It is probably not made for this task. Then I remembered about the pageinspect

Re: [GENERAL] check database integrity

2014-07-20 Thread Andrew Sullivan
On Sun, Jul 20, 2014 at 02:57:20PM +0200, Torsten Förtsch wrote: I ran this query in a separate transaction. The memory was freed only when the backend process exited. Is there a way to work around this memory leak? Why do you think it's a memory leak. You asked for the full dataset; you

Re: [GENERAL] serious issue with age(relfrozenxid)::int.

2014-07-20 Thread Adrian Klaver
On 07/20/2014 01:05 AM, John R Pierce wrote: On 7/20/2014 12:29 AM, Prabhjot Sheena wrote: Most of my tables in postgresql database 8.3 is showing up this. Pls suggest me what should be done with this and if this is something really serious why are you casting age() to an int ? My

Re: [GENERAL] serious issue with age(relfrozenxid)::int.

2014-07-20 Thread Tom Lane
Prabhjot Sheena prabhjot.she...@rivalwatch.com writes: Most of my tables in postgresql database 8.3 is showing up this. Pls suggest me what should be done with this and if this is something really serious There's no reason to think that this means anything at all. You did not bother

Re: [GENERAL] check database integrity

2014-07-20 Thread Tom Lane
=?ISO-8859-1?Q?Torsten_F=F6rtsch?= torsten.foert...@gmx.net writes: Then I remembered about the pageinspect extension. The following select is a bit too verbose but it seems to do the job for everything except fsm files. SELECT c.oid::regclass::text as rel, f.fork,

Re: [GENERAL] Petition: Treat #!... shebangs as comments

2014-07-20 Thread Francisco Olarte
Hi Merlin: On Fri, Jul 18, 2014 at 9:23 PM, Merlin Moncure mmonc...@gmail.com wrote: snip, snip Anyway, this is a little bit complex, as psql many times needs arguments. true, but pretty much everything you might need can be handled via the environment and the script itself. there

Re: [GENERAL] Petition: Treat #!... shebangs as comments

2014-07-20 Thread Francisco Olarte
Hi Andrew... On Fri, Jul 18, 2014 at 9:37 PM, Andrew Pennebaker andrew.penneba...@gmail.com wrote: As a workaround, I can use this shebang hack: ... More 'this no shebang hack'. But I would prefer to use a traditional (#!/usr/bin/env psql -f) shebang. It took a few hours on irc to hack this

Re: [GENERAL] Petition: Treat #!... shebangs as comments

2014-07-20 Thread Francisco Olarte
Hi Karsten: On Fri, Jul 18, 2014 at 9:47 PM, Karsten Hilbert karsten.hilb...@gmx.net wrote: Nice solution but that won't work on Windows ... If psql -f kk.psql does, it works enough. ./kk.psql would not notmally work on windows. It's been 12 years since I worked on it, but IIRC although windows

Re: [GENERAL] Petition: Treat #!... shebangs as comments

2014-07-20 Thread Francisco Olarte
Hi John: On Fri, Jul 18, 2014 at 10:41 PM, John McKown john.archie.mck...@gmail.com wrote: FWIW - I like #! also. Even though it may cause the Windows users to want something equivalent. Assuming there are any Windows people who really use a command prompt. I do not now, given the current

[GENERAL] Copying a database.

2014-07-20 Thread maillists0
I send a nightly dump of my production database to a development server. A script drops the existing development database and replaces it with the current production copy. Each dev uses her own copy of the database. Is there a way to copy the current development database to a differently named db

Re: [GENERAL] Copying a database.

2014-07-20 Thread Steve Atkins
On Jul 20, 2014, at 11:09 AM, maillis...@gmail.com wrote: I send a nightly dump of my production database to a development server. A script drops the existing development database and replaces it with the current production copy. Each dev uses her own copy of the database. Is there a

Re: [GENERAL] Copying a database.

2014-07-20 Thread Adrian Klaver
On 07/20/2014 11:28 AM, Steve Atkins wrote: On Jul 20, 2014, at 11:09 AM, maillis...@gmail.com wrote: I send a nightly dump of my production database to a development server. A script drops the existing development database and replaces it with the current production copy. Each dev uses

Re: [GENERAL] check database integrity

2014-07-20 Thread Torsten Förtsch
On 20/07/14 17:35, Tom Lane wrote: =?ISO-8859-1?Q?Torsten_F=F6rtsch?= torsten.foert...@gmx.net writes: Then I remembered about the pageinspect extension. The following select is a bit too verbose but it seems to do the job for everything except fsm files. SELECT

Re: [GENERAL] check database integrity

2014-07-20 Thread Torsten Förtsch
On 20/07/14 16:02, Andrew Sullivan wrote: Then I could also use it in production. But currently I need it only to verify a backup. If you need to verify a backup, why isn't pg_dump acceptable? Or is it that you are somehow trying to prove that what you have on the target (backup) machine