Re: [GENERAL] Parallel Insert and Delete operation

2012-11-05 Thread Yelai, Ramkumar IN BLR STS
Thanks Albe Laurenz, Moshe Jacobson @Albe - I got you first point. The second point is little skeptical because postgres could have been avoided this lock by using MVCC. Please correct me if I am wrong? @ Jacobson - it could be possible that foreign key violation may arise but when it arise

[GENERAL] Memory issue on FreeBSD

2012-11-05 Thread Frank Broniewski
Hi, I am running a PostgreSQL server on FreeBSD. The system has 32GB memory. Usually I use top to examine the memory usage of the system. After a while, a part, approximately 5GB, vanish from top, so that the memory rounds up to 27GB. After restarting PostgreSQL, I have all 32GB again availa

Re: [GENERAL] Parallel Insert and Delete operation

2012-11-05 Thread Albe Laurenz
Ramkumar Yelai wrote: [is worried that a database might become inconsistent if conflicting INSERTs and DELETEs occur] > @Albe - I got you first point. The second point is little skeptical because postgres could have been > avoided this lock by using MVCC. Please correct me if I am wrong? Which l

Re: [GENERAL] Corrupt Incrementally Updated Backup: missing pg_clog file

2012-11-05 Thread Albe Laurenz
Jeff Janes wrote: > On Wed, Oct 31, 2012 at 7:24 AM, Jürgen Fuchsberger > wrote: > > I have a problem with a corrupt backup, fortunately I was only testing so I > > did not loose any data. Unfortunetely what I did is to follow the backup > > guidelines in the documentation, which I thought should

Re: [GENERAL] Recover from failed files

2012-11-05 Thread Richard Huxton
On 04/11/12 23:28, Nyamul Hassan wrote: Upon inspecting the hard drive, we were able to salvage the "data" folder, but when we try to load it into the PGSQL version of the data folder (8.2), the server would not load. Upon closer inspection, we suspect the culprit to be the file 0015 in pg_clo

Re: [GENERAL] Using PostgreSQL for NSS databases

2012-11-05 Thread Adam Tauno Williams
On Thu, 2012-11-01 at 14:28 -0400, Daniel Popowich wrote: > I'm making this post here in hopes I may save someone from beating > their head against the wall like I did... > I am writing a custom Name Service Switch (NSS) module to take > advantage of already existing account information in a pg dat

Re: [GENERAL] Memory issue on FreeBSD

2012-11-05 Thread Achilleas Mantzios
ipcs in FreeBSD is a little ... tricky. ipcs -M ipcs -m ipcs -am could be your friends On Δευ 05 Νοε 2012 11:22:46 Frank Broniewski wrote: > Hi, > > I am running a PostgreSQL server on FreeBSD. The system has 32GB memory. > Usually I use top to examine the memory usage of the system. After a

Re: [GENERAL] Memory issue on FreeBSD

2012-11-05 Thread Achilleas Mantzios
(scrap my previous internal email (hence fake) address this one is correct : sorry for that) You can stop pgsql, start it and then watch out for the increase in SEGSZ values. I pretty much think they are in bytes. I am pretty confident that this value depicts the shared_buffers size in bytes.

[GENERAL] lock database share

2012-11-05 Thread salah jubeh
Hello, I have the following scenario, I would like to upgrade a database server from 8.3 to 9.1. The upgrade includes also a hardware upgrade. I would like to have the following 1. Make sure that the upgraded server and the old server have the same snapshot of data. 2. Make sure that the old

Re: [GENERAL] Memory issue on FreeBSD

2012-11-05 Thread Frank Broniewski
Hi, thank you for your feedback. I had a look at those commands and their output, especially in conjunction with the SEGSZ value from icps -am Here's an example output: # ipcs -am Shared Memory: T ID KEY MODEOWNERGROUPCREATOR CGROUP NATTCHSE

Re: [GENERAL] Memory issue on FreeBSD

2012-11-05 Thread Achilleas Mantzios
How do you measure that smth is missing from top? What values do you add? I am currently running 8.3 but we shouldn't be so far apart top-wise. What is the reading under SIZE and RES in top for all postgresql processes? Take note that shared mem should be recorded for each and every postmaster run

[GENERAL] Problem with heap_form_tuple error

2012-11-05 Thread Stephen Woodbridge
Hi all, I'm have a problem with heap_form_tuple error ERROR: invalid memory alloc request size 1149502660 I've read through a ton of examples and read through the code and the docs and I'm sure I'm doing something stupid but I'm not seeing it. I have included a very reduced sample of the c

Re: [GENERAL] Memory issue on FreeBSD

2012-11-05 Thread Frank Broniewski
Hi, I just add the different memory values together (minus the buffers). Usually this sums up (+/-) to the installed memory size, at least on my other machines. I found a thread similar to my problem here [1], but no solution. I don't mind top showing false values, but if there's a larger pro

[GENERAL] Error registering at postgresql.org

2012-11-05 Thread Daniel Serodio (lists)
I'm trying to register at postgresql.org so I can edit the wiki to fix a broken link. I received a link on my e-mail so I could set my password, but when I submit the "Change password" form I get an error: Forbidden (403) CSRF verification failed. Request aborted. More information is available

Re: [GENERAL] Problem with heap_form_tuple error

2012-11-05 Thread Tom Lane
Stephen Woodbridge writes: > I'm have a problem with heap_form_tuple error > ERROR: invalid memory alloc request size 1149502660 > I've read through a ton of examples and read through the code and the > docs and I'm sure I'm doing something stupid but I'm not seeing it. Hm ... you're settin

Re: [GENERAL] Memory issue on FreeBSD

2012-11-05 Thread Achilleas Mantzios
Since the top reporting goes back to normal when postgresql is stopped , and since postgresql is special due to the use of IPC, i would be inclined to think that the culprit here is the shared memory. I don't know where maintenance_work_mem really lives (process normal address space or IPC share

Re: [GENERAL] Error registering at postgresql.org

2012-11-05 Thread Magnus Hagander
On Mon, Nov 5, 2012 at 4:21 PM, Daniel Serodio (lists) < daniel.li...@mandic.com.br> wrote: > I'm trying to register at postgresql.org so I can edit the wiki to fix a > broken link. I received a link on my e-mail so I could set my password, but > when I submit the "Change password" form I get an e

[GENERAL] Select Query Modification:Details needed

2012-11-05 Thread RAJDEEP SARDAR
Dear All, I am having a database course project where I need to make some modification in postgresql. For this I need to modify  a select query and add some condition to it. I need to find out the formclause and whereclause of the select query after it is parsed.To do that,I have found a st

Re: [GENERAL] Problem with heap_form_tuple error

2012-11-05 Thread Stephen Woodbridge
On 11/5/2012 10:34 AM, Tom Lane wrote: Stephen Woodbridge writes: I'm have a problem with heap_form_tuple error ERROR: invalid memory alloc request size 1149502660 I've read through a ton of examples and read through the code and the docs and I'm sure I'm doing something stupid but I'm no

Re: [GENERAL] lock database share

2012-11-05 Thread Alan Hodgson
On Monday, November 05, 2012 05:15:41 AM salah jubeh wrote: > Hello, > > I have the following scenario, I would like to upgrade a database server > from 8.3 to 9.1. The upgrade includes also a hardware upgrade. > > > I would like to have the following > > 1. Make sure that the upgraded server a

[GENERAL] deadlock detected

2012-11-05 Thread AI Rumman
Hi all, I am using Postrgesql 9.1 I got a message in my log: ERROR: deadlock detected DETAIL: Process 20265 waits for ShareLock on transaction 27774015; blocked by process 20262. Process 20262 waits for ShareLock on transaction 27774018; blocked by process 20265. Process 20265:

Re: [GENERAL] deadlock detected

2012-11-05 Thread Richard Huxton
On 05/11/12 18:39, AI Rumman wrote: Hi all, I am using Postrgesql 9.1 I got a message in my log: ERROR: deadlock detected DETAIL: Process 20265 waits for ShareLock on transaction 27774015; blocked by process 20262. Process 20262 waits for ShareLock on transaction 27774018; blocked b

Re: [GENERAL] Problem with heap_form_tuple error

2012-11-05 Thread Tom Lane
Stephen Woodbridge writes: > Thanks, changing my code to use BuildTupleFromCStrings did the trick. So > if I wanted to do some like my code was doing what is the proper way to > convert a CString into varchar and then that into Datum? Personally I'd use cstring_to_text (relying on the knowledge

Re: [GENERAL] deadlock detected

2012-11-05 Thread Tom Lane
Richard Huxton writes: > On 05/11/12 18:39, AI Rumman wrote: >> ERROR: deadlock detected >> DETAIL: Process 20265 waits for ShareLock on transaction 27774015; >> blocked by process 20262. >> Process 20262 waits for ShareLock on transaction 27774018; >> blocked by process 20265. >> Process 2026

[GENERAL] Difference between varchar and text?

2012-11-05 Thread Moshe Jacobson
Is there any practical difference between defining a column as a varchar(n)vs. a varchar vs. a text field? I've always been under the impression that if I am wanting to index a varchar column, it is better to set a maximum length. Is this correct? But more importantly, what's the practical differe

Re: [GENERAL] Difference between varchar and text?

2012-11-05 Thread Merlin Moncure
On Mon, Nov 5, 2012 at 2:46 PM, Moshe Jacobson wrote: > Is there any practical difference between defining a column as a varchar(n) > vs. a varchar vs. a text field? not much. varchar(n) only forces the length to be <= n. I dislike inventing an 'n' when one is not known, but a lot of people do

Re: [GENERAL] Difference between varchar and text?

2012-11-05 Thread John R Pierce
On 11/05/12 12:46 PM, Moshe Jacobson wrote: Is there any practical difference between defining a column as a varchar(n) vs. a varchar vs. a text field? varchar(n) has a length constraint on it. the other two don't. otherwise all three are identical in implementation. I've always been unde

Re: [GENERAL] Difference between varchar and text?

2012-11-05 Thread Joshua D. Drake
On 11/05/2012 12:46 PM, Moshe Jacobson wrote: Is there any practical difference between defining a column as a varchar(n) vs. a varchar vs. a text field? No except for your already noted exception that you can limit the size of varchar. I've always been under the impression that if I am w

Re: [GENERAL] Difference between varchar and text?

2012-11-05 Thread David Johnston
There is no practical difference between "varchar" and "text". "varchar(n)" is also not really any different than "varchar CHECK length(varchar) <= n" - meaning that the implementation of the data is the same but validation occurs during entry. One thing I have seen is that "varchar" is someti

[GENERAL] Quick estimate of num of rows & table size

2012-11-05 Thread Thalis Kalfigkopoulos
Hi all, I read somewhere that the following query gives a quick estimate of the # of rows in a table regardless of the table's size (which would matter in a simple SELECT count(*)?): SELECT (CASE WHEN reltuples > 0 THEN pg_relation_size('mytable')/(8192*relpages/reltuples) ELSE 0 END)::bigint AS

Re: [GENERAL] Quick estimate of num of rows & table size

2012-11-05 Thread Lonni J Friedman
On Mon, Nov 5, 2012 at 2:02 PM, Thalis Kalfigkopoulos wrote: > Hi all, > > I read somewhere that the following query gives a quick estimate of the # of > rows in a table regardless of the table's size (which would matter in a > simple SELECT count(*)?): > > SELECT (CASE WHEN reltuples > 0 THEN > p

Re: [GENERAL] Quick estimate of num of rows & table size

2012-11-05 Thread Thalis Kalfigkopoulos
On Mon, Nov 5, 2012 at 7:14 PM, Lonni J Friedman wrote: > On Mon, Nov 5, 2012 at 2:02 PM, Thalis Kalfigkopoulos > wrote: > > Hi all, > > > > I read somewhere that the following query gives a quick estimate of the > # of > > rows in a table regardless of the table's size (which would matter in a

Re: [GENERAL] Quick estimate of num of rows & table size

2012-11-05 Thread Lonni J Friedman
On Mon, Nov 5, 2012 at 3:56 PM, Thalis Kalfigkopoulos wrote: > > On Mon, Nov 5, 2012 at 7:14 PM, Lonni J Friedman wrote: >> >> On Mon, Nov 5, 2012 at 2:02 PM, Thalis Kalfigkopoulos >> wrote: >> > Hi all, >> > >> > I read somewhere that the following query gives a quick estimate of the >> > # of

Re: [GENERAL] Quick estimate of num of rows & table size

2012-11-05 Thread Thalis Kalfigkopoulos
On Mon, Nov 5, 2012 at 9:04 PM, Lonni J Friedman wrote: > On Mon, Nov 5, 2012 at 3:56 PM, Thalis Kalfigkopoulos > wrote: > > > > On Mon, Nov 5, 2012 at 7:14 PM, Lonni J Friedman > wrote: > >> > >> On Mon, Nov 5, 2012 at 2:02 PM, Thalis Kalfigkopoulos > >> wrote: > >> > Hi all, > >> > > >> > I

Re: [GENERAL] Pg isolation levels: 3 or 2?

2012-11-05 Thread Kevin Grittner
Peter Geoghegan wrote: > Thalis Kalfigkopoulos wrote: >> How is that three levels and not two? Read Uncommitted and Read >> Commited are the same. And Repeatable Reads don't allow phantom >> reads thus making them effectively the same as Serializable. No? No. > They're only equivalent to the ex

Re: [GENERAL] Quick estimate of num of rows & table size

2012-11-05 Thread Tom Lane
Thalis Kalfigkopoulos writes: > I read somewhere that the following query gives a quick estimate of the # > of rows in a table regardless of the table's size (which would matter in a > simple SELECT count(*)?): > SELECT (CASE WHEN reltuples > 0 THEN > pg_relation_size('mytable')/(8192*relpages/re

[GENERAL] Unexpectedly high disk space usage

2012-11-05 Thread Lists
We upgraded to 9.1 from 8.4 over the summer a few months ago, to new DB servers with more disk space and memory. Unexpectedly, the DB servers have steadily increased their disk space usage since. Reported system load doesn't seem to be affected. It's happening to all our DB servers running 9.1.

Re: [GENERAL] Unexpectedly high disk space usage

2012-11-05 Thread Scott Marlowe
On Mon, Nov 5, 2012 at 8:01 PM, Lists wrote: > We upgraded to 9.1 from 8.4 over the summer a few months ago, to new DB > servers with more disk space and memory. Unexpectedly, the DB servers have > steadily increased their disk space usage since. Reported system load > doesn't seem to be affected.

[GENERAL] Hot Standby Not So Hot Anymore

2012-11-05 Thread Ian Harding
I had a 9.0.8 hot standby setup, one master, two slaves, working great. Then, I tried to re-initialize by making a base backup, the way I've done it many times before, but for some reason I can't get the standby to accept connections. I copied the postgresql.conf and recorvery.conf out of the way,

Re: [GENERAL] Hot Standby Not So Hot Anymore

2012-11-05 Thread Lonni J Friedman
On Mon, Nov 5, 2012 at 7:40 PM, Ian Harding wrote: > I had a 9.0.8 hot standby setup, one master, two slaves, working great. > Then, I tried to re-initialize by making a base backup, the way I've done it > many times before, but for some reason I can't get the standby to accept > connections. I c

Re: [GENERAL] Hot Standby Not So Hot Anymore

2012-11-05 Thread Ian Harding
On Mon, Nov 5, 2012 at 7:46 PM, Lonni J Friedman wrote: > On Mon, Nov 5, 2012 at 7:40 PM, Ian Harding wrote: > > I had a 9.0.8 hot standby setup, one master, two slaves, working great. > > Then, I tried to re-initialize by making a base backup, the way I've > done it > > many times before, but f

Re: [GENERAL] Hot Standby Not So Hot Anymore

2012-11-05 Thread Lonni J Friedman
On Mon, Nov 5, 2012 at 7:49 PM, Ian Harding wrote: > > > On Mon, Nov 5, 2012 at 7:46 PM, Lonni J Friedman wrote: >> >> On Mon, Nov 5, 2012 at 7:40 PM, Ian Harding wrote: >> > I had a 9.0.8 hot standby setup, one master, two slaves, working great. >> > Then, I tried to re-initialize by making a b

Re: [GENERAL] Hot Standby Not So Hot Anymore

2012-11-05 Thread Ian Harding
On Mon, Nov 5, 2012 at 7:57 PM, Lonni J Friedman wrote: > On Mon, Nov 5, 2012 at 7:49 PM, Ian Harding wrote: > > > > > > On Mon, Nov 5, 2012 at 7:46 PM, Lonni J Friedman > wrote: > >> > >> On Mon, Nov 5, 2012 at 7:40 PM, Ian Harding > wrote: > >> > I had a 9.0.8 hot standby setup, one master,

Re: [GENERAL] Hot Standby Not So Hot Anymore

2012-11-05 Thread Lonni J Friedman
On Mon, Nov 5, 2012 at 8:13 PM, Ian Harding wrote: > > > > On Mon, Nov 5, 2012 at 7:57 PM, Lonni J Friedman wrote: >> >> On Mon, Nov 5, 2012 at 7:49 PM, Ian Harding wrote: >> > >> > >> > On Mon, Nov 5, 2012 at 7:46 PM, Lonni J Friedman >> > wrote: >> >> >> >> On Mon, Nov 5, 2012 at 7:40 PM, Ian

Re: [GENERAL] Hot Standby Not So Hot Anymore

2012-11-05 Thread Ian Harding
On Mon, Nov 5, 2012 at 8:15 PM, Lonni J Friedman wrote: > On Mon, Nov 5, 2012 at 8:13 PM, Ian Harding wrote: > > > > > > > > On Mon, Nov 5, 2012 at 7:57 PM, Lonni J Friedman > wrote: > >> > >> On Mon, Nov 5, 2012 at 7:49 PM, Ian Harding > wrote: > >> > > >> > > >> > On Mon, Nov 5, 2012 at 7:46

Re: [GENERAL] Hot Standby Not So Hot Anymore

2012-11-05 Thread Lonni J Friedman
On Mon, Nov 5, 2012 at 8:31 PM, Ian Harding wrote: > > > > On Mon, Nov 5, 2012 at 8:15 PM, Lonni J Friedman wrote: >> >> On Mon, Nov 5, 2012 at 8:13 PM, Ian Harding wrote: >> > >> > >> > >> > On Mon, Nov 5, 2012 at 7:57 PM, Lonni J Friedman >> > wrote: >> >> >> >> On Mon, Nov 5, 2012 at 7:49 PM

Re: [GENERAL] Unexpectedly high disk space usage

2012-11-05 Thread Jeff Janes
On Mon, Nov 5, 2012 at 7:01 PM, Lists wrote: > We upgraded to 9.1 from 8.4 over the summer a few months ago, to new DB > servers with more disk space and memory. Unexpectedly, the DB servers have > steadily increased their disk space usage since. Reported system load > doesn't seem to be affected.

Re: [GENERAL] Hot Standby Not So Hot Anymore

2012-11-05 Thread Darren Duncan
Ian Harding wrote: On Mon, Nov 5, 2012 at 7:46 PM, Lonni J Friedman wrote: It says everything is happy as normal... 2012-11-05 16:22:41.200 PST - :LOG: invalid record length at BA6/6DCBA48 What does this log line mean? Is that "happy as normal"? -- Darren Duncan -- Sent via pgsql-general

[GENERAL] Question about data corruption issue of 9.1 (pre 9.1.6)

2012-11-05 Thread Denis Gasparin
Hi to all. We have a 9.1.5 production database that never crashed and today we upgraded it to 9.1.6. The question: do we need to follow the vacuum/reindex procedure (as specified here http://wiki.postgresql.org/wiki/20120924updaterelease ) even if the database never crashed? Thank you

[GENERAL] Exclusion constraints with time expressions

2012-11-05 Thread Thomas Munro
Hi I am using 9.1.6, and I've set up a partitioned table as described in the manual, with partitions based on a timestamptz column called 'time'. The exclusion constraints work nicely when I select ranges of times with literal constants. But why would a WHERE clause like the following not benefi

[GENERAL] Does PostgreSQL have complete functional test cases?

2012-11-05 Thread Tianyin Xu
Hi, Does anyone know whether PostgreSQL has complete functional test cases? And where can I find them? Currently, I only find some test cases in "PG_SOURCE/src/tests", but it seems that they are pretty simple and do not cover a lot of features of PostgreSQL. Thanks a lot! Tianyin -- Tianyin XU

Re: [GENERAL] Question about data corruption issue of 9.1 (pre 9.1.6)

2012-11-05 Thread Craig Ringer
On 11/06/2012 03:00 PM, Denis Gasparin wrote: > > Hi to all. > > We have a 9.1.5 production database that never crashed and today we > upgraded it to 9.1.6. > > The question: do we need to follow the vacuum/reindex procedure (as > specified here http://wiki.postgresql.org/wiki/20120924updaterelease