[GENERAL] question about dynahash

2014-07-20 Thread Xiaoyulei
Hi, I have a question about dynahash.c. PG dynahash search, with the increase in the number of elements inserted, the value of high_maskwill be more greater. The calculation method of bucket is hashvalue & high_mask, hashvalue for the same key, each calculated value is the same, but the value o

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) ma

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?= 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, >>

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 her

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

[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] Petition: Treat #!... shebangs as comments

2014-07-20 Thread Francisco Olarte
Hi John: On Fri, Jul 18, 2014 at 10:41 PM, John McKown 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 trend of changing thing for

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 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 ( the OS ) recognize

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 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 one together. I see why.

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 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 are plenty of go

Re: [GENERAL] check database integrity

2014-07-20 Thread Tom Lane
=?ISO-8859-1?Q?Torsten_F=F6rtsch?= 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, >ser.i

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

2014-07-20 Thread Tom Lane
Prabhjot Sheena 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 to filter by relkind, so mo

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] 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

[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 extension.

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 myste

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

[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