[GENERAL] currval and DISCARD ALL

2013-04-15 Thread Nigel Heron
Hi, is there a way to clear the session state of sequence values fetched by currval(regclass)? "DISCARD ALL" doesn't seem to do it. eg. (w/ pg 9.2.4) test=# CREATE SEQUENCE foo_seq; CREATE SEQUENCE test=# SELECT nextval('foo_seq'); -[ RECORD 1 ] nextval | 1 test=# SELECT currval('foo_seq'); -[

Re: [GENERAL] currval and DISCARD ALL

2013-04-16 Thread Nigel Heron
On 04/15/2013 05:57 PM, Adrian Klaver wrote: On 04/15/2013 02:42 PM, Nigel Heron wrote: Hi, is there a way to clear the session state of sequence values fetched by currval(regclass)? "DISCARD ALL" doesn't seem to do it. Might want to take a look at: http://www.depesz.com/

[GENERAL] blks_read/blks_hit stats

2011-06-15 Thread Nigel Heron
Hi everyone, I'm playing with the stats views and functions to graph them in cacti.. Adding up *_blks_hit (heap, idx, toast and tidx) from pg_statio doesn't match blks_hit in pg_stat_database. Sometimes the sum is higher, sometimes lower. Do they have similar names but represent different metri

Re: [GENERAL] blks_read/blks_hit stats

2011-06-25 Thread Nigel Heron
On 11-06-15 12:38 PM, Nigel Heron wrote: Hi everyone, I'm playing with the stats views and functions to graph them in cacti.. Adding up *_blks_hit (heap, idx, toast and tidx) from pg_statio doesn't match blks_hit in pg_stat_database. Sometimes the sum is higher, sometimes lower. Do

[GENERAL] issue with pg_restore

2011-07-27 Thread Nigel Heron
Hi list, I'm trying to restore a backup into a database with a new name the dump was done on a 8.4 server with: pg_dump -F c -f bakfile olddb i'm trying to restore it with: createdb newdb; pg_restore -v --jobs=4 --disable-triggers --no-tablespaces --dbname=newdb bakfile or even just: createdb

Re: [GENERAL] issue with pg_restore

2011-07-28 Thread Nigel Heron
On 11-07-28 09:41 AM, Tom Lane wrote: Adrian Klaver writes: On Wednesday, July 27, 2011 9:19:38 pm Nigel Heron wrote: I'm trying to restore a backup into a database with a new name It doesn't work .. pg_restore claims to be creating tables, indexes, etc. and there are no err

Re: [GENERAL] duplicate key errors when restoring 8.4.0 database dump into 9.1.2

2011-12-30 Thread Nigel Heron
On 11-12-30 10:49 AM, Culley Harrelson wrote: They are just your standard sql errors seen in the output of psql mydb < backup.sql ALTER TABLE ERROR: could not create unique index "ht_user_pkey" DETAIL: Key (user_id)=(653009) is duplicated. There is a unique index on user_id in the 8..4.0