Re: [GENERAL] Why the ERROR: duplicate key violates unique constraint "master_pkey" is raised? - Is this a Bug?

2007-09-25 Thread David Fetter
On Mon, Sep 24, 2007 at 12:50:22PM +0530, Anoo Sivadasan Pillai wrote: > I am using "PostgreSQL 8.2.4 on i686-pc-mingw32, compiled by GCC > gcc.exe (GCC) 3.4.2 (mingw-special)" on Windows 2003 server > > While I am trying to update a prmary key It is failing with the > following message "ERROR:

Re: [GENERAL] NZDT Question

2007-09-25 Thread Mike C
On 9/26/07, Tom Lane <[EMAIL PROTECTED]> wrote: > > regression=# set timezone to 'Pacific/Auckland'; > SET > regression=# select '2007-10-01 06:12:40.097244+12'::timestamptz; > timestamptz > --- > 2007-10-01 07:12:40.097244+13 > (1 row) > > What have you got "

Re: [GENERAL] NZDT Question

2007-09-25 Thread Tom Lane
"Mike C" <[EMAIL PROTECTED]> writes: > I've just upgraded from Postgres 8.1.0 to 8.1.10 to update the NZ > timezone changes, but it doesn't seem to make a difference (I've also > patched linux). Ideas? Hm, works for me: Welcome to psql 8.1.10, the PostgreSQL interactive terminal. Type: \copyrig

Re: [GENERAL] subquery/alias question

2007-09-25 Thread Michael Glaesemann
On Sep 25, 2007, at 21:44 , Tom Lane wrote: ... which in English means we just do the calculation once ... As always, thanks, Tom, for the explanation (and Alvaro, who probably already knew this :)) Michael Glaesemann grzm seespotcode net ---(end of broadcast)--

[GENERAL] NZDT Question

2007-09-25 Thread Mike C
Hi, I've just upgraded from Postgres 8.1.0 to 8.1.10 to update the NZ timezone changes, but it doesn't seem to make a difference (I've also patched linux). Ideas? Below is how I'm testing (artificially set time into future): -bash-3.1$ date Mon Oct 1 07:12:36 NZDT 2007 -bash-3.1$ psql test Welc

Re: [GENERAL] subquery/alias question

2007-09-25 Thread Tom Lane
Michael Glaesemann <[EMAIL PROTECTED]> writes: > I believe you'd have to write it like > select dom_id, dom_name, count(usr_dom_id) as usr_count >from domains >join users on (usr_dom_id = dom_id) >having count(usr_dom_id) > 0 >order by dom_name; > I don't know how the performance

Re: [GENERAL] subquery/alias question

2007-09-25 Thread Michael Glaesemann
On Sep 25, 2007, at 17:30 , Alvaro Herrera wrote: Michael Glaesemann wrote: select dom_id, dom_name, usr_count from domains natural join (select usr_dom_id as dom_id, count(usr_dom_id) as usr_count from users) u where usr_count > 0

Re: [GENERAL] subquery/alias question

2007-09-25 Thread Alvaro Herrera
Michael Glaesemann wrote: > > On Sep 25, 2007, at 16:59 , Madison Kelly wrote: > >> SELECT >> d.dom_id, >> d.dom_name, >> (SELECT COUNT(*) FROM users u WHERE u.usr_dom_id=d.dom_id) >> AS >> usr_count >> FROM >> domains d >> WHERE >> (SELECT COUNT(*) FROM users u W

Re: [GENERAL] lowering impact of checkpoints

2007-09-25 Thread Greg Smith
On Tue, 25 Sep 2007, Gregory Stark wrote: I'm surprised you don't start by suggesting lowering bgwriter_delay for a busy dedicated system. Does it cause too much wasted cpu work in the "all" cycle in 8.2? I've just found it easier to sort through this class of problem by getting the maxpages

Re: [GENERAL] subquery/alias question

2007-09-25 Thread Michael Glaesemann
On Sep 25, 2007, at 16:59 , Madison Kelly wrote: SELECT d.dom_id, d.dom_name, (SELECT COUNT(*) FROM users u WHERE u.usr_dom_id=d.dom_id) AS usr_count FROM domains d WHERE (SELECT COUNT(*) FROM users u WHERE u.usr_dom_id=d.dom_id) > 0 ORDER

Re: [GENERAL] Can't connect (2 dbs) or login (2 others)

2007-09-25 Thread Scott Marlowe
On 9/25/07, Morris Goldstein <[EMAIL PROTECTED]> wrote: > On 9/25/07, Scott Marlowe <[EMAIL PROTECTED]> wrote: > > But since it hit all of your machines, and at about the same time, I > > tend to think that someone did something to these machines that caused > > this issue, and it's not a 7.4.x pro

[GENERAL] subquery/alias question

2007-09-25 Thread Madison Kelly
Hi all, I've read 7.2.1.3 (as short as it is) in the PgSQL docs, but don't see what I am doing wrong... Maybe you can help? I've got a query; SELECT d.dom_id, d.dom_name, (SELECT COUNT(*) FROM users u WHERE u.usr_dom_id=d.dom_id) AS usr_count FROM

Re: [GENERAL] pg_restore - invalid file problem

2007-09-25 Thread Rodrigo De Le�
On 9/25/07, Ralph Smith <[EMAIL PROTECTED]> wrote: > Where should I start looking for sources of the error? See: http://www.postgresql.org/docs/7.4/static/backup.html#BACKUP-DUMP-ALL ---(end of broadcast)--- TIP 5: don't forget to increase your free

Re: [GENERAL] Can't connect (2 dbs) or login (2 others)

2007-09-25 Thread Tom Lane
"Morris Goldstein" <[EMAIL PROTECTED]> writes: > We've recovered. There is root cause analysis going on. The question is > whether I can use an argument about 8.0 vs. 7.4 reliability from this fiasco > to help us get to 8.0. > 8.0 actually is more reliable than 7.4, I assume. I don't know that I'd

[GENERAL] pg_restore - invalid file problem

2007-09-25 Thread Ralph Smith
In preparing to upgrade, (a long story), of our version 7.4 database cluster, I'm trying pg_restore using the file from pg_dumpall, also version 7.4 into a virgin install of PostgreSQL 7.4 on Ubuntu. Postmaster is up and running (c/o ps -ef) The error I get: pg_restore: [archiver] input file do

Re: [GENERAL] cascade and restrict options to alter domain drop constraint

2007-09-25 Thread Tom Lane
Marc Munro <[EMAIL PROTECTED]> writes: > I am puzzled by the cascade and restrict options to the alter domain > drop constraint command. They don't do anything. I think they were put in because we have this meme that the SQL spec requires RESTRICT/CASCADE options on every type of DROP, but so far

Re: [GENERAL] Manually clearing "database "foo" is being accessed by other users"

2007-09-25 Thread Madison Kelly
Steve Crawford wrote: > Sysadmin wrote: >> Hi all, >> >> I'm finding that routinely when I try to reload a database on a server >> where I know there are no connections to a given DB I get the error: >> >> $ dropdb foo && createdb foo -O bar && psql foo -f /path/to/db.out >> dropdb: database remo

Re: [GENERAL] Can't connect (2 dbs) or login (2 others)

2007-09-25 Thread Morris Goldstein
On 9/25/07, Scott Marlowe <[EMAIL PROTECTED]> wrote: > > But since it hit all of your machines, and at about the same time, I > tend to think that someone did something to these machines that caused > this issue, and it's not a 7.4.x problem. I'm sure it is pilot error, and we're still trying to

Re: [GENERAL] lowering impact of checkpoints

2007-09-25 Thread Gregory Stark
"Greg Smith" <[EMAIL PROTECTED]> writes: > On Tue, 25 Sep 2007, hubert depesz lubaczewski wrote: > >> name | setting | unit >> ---+---+ >> bgwriter_all_maxpages | 5 | >> bgwriter_all_percent | 0.333 | [null] >> bgwriter_delay

Re: [GENERAL] Can't connect (2 dbs) or login (2 others)

2007-09-25 Thread Scott Marlowe
On 9/25/07, Morris Goldstein <[EMAIL PROTECTED]> wrote: > Thanks for your help with pg_resetxlog. It recovered all of our databases, > and it looks like we got lucky in that no updates were lost. > > We are deciding on the goals for our next release, and one of the issues on > the table is an upgra

[GENERAL] cascade and restrict options to alter domain drop constraint

2007-09-25 Thread Marc Munro
I am puzzled by the cascade and restrict options to the alter domain drop constraint command. I do not see how a dropping a check constraint should cascade to anything, or indeed be restricted by anything. My reasoning is simple: if I drop a check constraint on a domain, no data should be affecte

Re: [GENERAL] Can't connect (2 dbs) or login (2 others)

2007-09-25 Thread Morris Goldstein
Thanks for your help with pg_resetxlog. It recovered all of our databases, and it looks like we got lucky in that no updates were lost. We are deciding on the goals for our next release, and one of the issues on the table is an upgrade to postgres 8. Can you comment on the improvements in performa

Re: [GENERAL] Yum Repository for Postgres 8.2.5

2007-09-25 Thread Devrim GÜNDÜZ
Hi, On Tue, 2007-09-25 at 12:39 -0400, David Siebert wrote: > I am using CentOS 5 and would like to update to 8.2.5. Does anyone > know of a repository that carries it? RedHat 5 should work as well. I am about to create a yum repository for PGDG RPMs. The infrastructure is ready, but I have som

[GENERAL] Yum Repository for Postgres 8.2.5

2007-09-25 Thread David Siebert
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I am using CentOS 5 and would like to update to 8.2.5. Does anyone know of a repository that carries it? RedHat 5 should work as well. -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.3-nr1 (Windows XP) Comment: Using GnuPG with Mozilla - http://eni

Re: [GENERAL] lowering impact of checkpoints

2007-09-25 Thread Greg Smith
On Tue, 25 Sep 2007, hubert depesz lubaczewski wrote: name | setting | unit ---+---+ bgwriter_all_maxpages | 5 | bgwriter_all_percent | 0.333 | [null] bgwriter_delay| 200 | ms bgwriter_lru_maxpages | 5 | b

Re: [GENERAL] set returning functions.

2007-09-25 Thread Merlin Moncure
On 9/25/07, Pavel Stehule <[EMAIL PROTECTED]> wrote: > 2007/9/25, Scott Marlowe <[EMAIL PROTECTED]>: > > On 9/24/07, Pavel Stehule <[EMAIL PROTECTED]> wrote: > > > 2007/9/25, Rhys Stewart <[EMAIL PROTECTED]>: > > > > yes indeed. thats exactly it scott!!! > > > > > > > > On 9/24/07, Scott Marlowe <[

Re: [GENERAL] Porblems migrating a server.

2007-09-25 Thread Michael Glaesemann
On Sep 25, 2007, at 10:37 , Alvaro Herrera wrote: Michael Glaesemann wrote: You might need to use adddepend, which is a contrib module included in 8.1 (not 8.2 AIUI). (Perhaps 8.2 includes this functionality in core? You can probably check the release notes for 8.2 for details.) Not in

Re: [GENERAL] Porblems migrating a server.

2007-09-25 Thread Alvaro Herrera
Michael Glaesemann wrote: > > On Sep 25, 2007, at 9:00 , David Siebert wrote: >> Any suggestions on what the command line should look like? > > You might need to use adddepend, which is a contrib module included in 8.1 > (not 8.2 AIUI). (Perhaps 8.2 includes this functionality in core? You can >

Re: [GENERAL] Porblems migrating a server.

2007-09-25 Thread Michael Glaesemann
On Sep 25, 2007, at 9:00 , David Siebert wrote: I have a very old postgres server that I am trying to move the data off of. It is running 7.1 and has been trouble free for 6 plus years. I am trying to move the data base off to a server running 8.1. In my opinion you should look at 8.2, not

Re: [GENERAL] PG_DUMP not working

2007-09-25 Thread Alvaro Herrera
Dan99 escribió: > Hi, > > I found out this morning that I cannot get pg_dump to work at all on > my database. It refuses to create a dump and instead just freezes. > When using the verbose option (-v) i get the following output and then > it stops (it at one point ran for days on end before i eve

Re: [GENERAL] A few basic troubleshooting questions

2007-09-25 Thread Erik Jones
On Sep 25, 2007, at 9:29 AM, Kevin Kempter wrote: Hi List; I have a few basic troubleshooting questions... 1) If I have autovacuum turned on, how do I know which table is being vacuumed when in pg_stat_activity I only see VACUUM? I've been using this query but it doesn't always work...

Re: [GENERAL] PG_DUMP not working

2007-09-25 Thread Scott Marlowe
On 9/18/07, Dan99 <[EMAIL PROTECTED]> wrote: > Hi, > > I found out this morning that I cannot get pg_dump to work at all on > my database. It refuses to create a dump and instead just freezes. > When using the verbose option (-v) i get the following output and then > it stops (it at one point ran

[GENERAL] A few basic troubleshooting questions

2007-09-25 Thread Kevin Kempter
Hi List; I have a few basic troubleshooting questions... 1) If I have autovacuum turned on, how do I know which table is being vacuumed when in pg_stat_activity I only see VACUUM? I've been using this query but it doesn't always work... is there a better way? CREATE Temp table tmp_p as SELECT

[GENERAL] Porblems migrating a server.

2007-09-25 Thread David Siebert
I have a very old postgres server that I am trying to move the data off of. It is running 7.1 and has been trouble free for 6 plus years. I am trying to move the data base off to a server running 8.1. I have managed to back up the data using PG_Dump using like this. " pg_dump -b -Fc -h stan.somepla

Re: [GENERAL] set returning functions.

2007-09-25 Thread Pavel Stehule
2007/9/25, Scott Marlowe <[EMAIL PROTECTED]>: > On 9/24/07, Pavel Stehule <[EMAIL PROTECTED]> wrote: > > 2007/9/25, Rhys Stewart <[EMAIL PROTECTED]>: > > > yes indeed. thats exactly it scott!!! > > > > > > On 9/24/07, Scott Marlowe <[EMAIL PROTECTED]> wrote: > > > > On 9/24/07, Pavel Stehule <[EMAI

Re: [GENERAL] set returning functions.

2007-09-25 Thread Scott Marlowe
On 9/24/07, Pavel Stehule <[EMAIL PROTECTED]> wrote: > 2007/9/25, Rhys Stewart <[EMAIL PROTECTED]>: > > yes indeed. thats exactly it scott!!! > > > > On 9/24/07, Scott Marlowe <[EMAIL PROTECTED]> wrote: > > > On 9/24/07, Pavel Stehule <[EMAIL PROTECTED]> wrote: > > > > Hello Rhys > > > > > > > > it

Re: [GENERAL] rules and command status question

2007-09-25 Thread Alvaro Herrera
Josh Harrison escribió: > Hello, > I have a question in the postgres document chapter 34. Rules and Command > Status. > The last paragraph of that page says that > > "The programmer can ensure that any desired INSTEAD rule is the one that > sets the command status in the second case, by giving it

Re: [GENERAL] lowering impact of checkpoints

2007-09-25 Thread Brad Nicholson
On Tue, 2007-09-25 at 11:58 +0200, hubert depesz lubaczewski wrote: > hi, > our system is handling between 600 and 2000 transactions per second. all > of them are very small, very fast. typical query runs in under 1ms. > yes - sometimes we get queries that take longer than then should get. > simple

[GENERAL] rules and command status question

2007-09-25 Thread Josh Harrison
Hello, I have a question in the postgres document chapter 34. Rules and Command Status. The last paragraph of that page says that "The programmer can ensure that any desired INSTEAD rule is the one that sets the command status in the second case, by giving it the alphabetically last rule name amon

Re: [GENERAL] Why the ERROR: duplicate key violates unique constraint "master_pkey" is raised? - Is this a Bug?

2007-09-25 Thread Ardian Xharra
It's normal behaviour, because after the first update it will be 2 same values for m2 and you don't want that since you have a unique constraint for that column. try this: CREATE TABLE master ( m1 INT primary key , m2 int unique ) ; INSERT INTO master VALUES ( 1, 1 ) ; INSERT INTO master VA

Fw: [GENERAL] PgpoolAdmin installation

2007-09-25 Thread Ashish Karalkar
- Original Message - From: Ashish Karalkar To: Devrim GÜNDÜZ Sent: Tuesday, September 25, 2007 4:30 PM Subject: Re: [GENERAL] PgpoolAdmin installation I got the answer for the same and is sloved it is just a file which gives information about the php installations. I have verified

Re: [GENERAL] Version 8.2.4 ecpg - function not found

2007-09-25 Thread Michael Meskes
On Thu, Sep 06, 2007 at 08:51:54AM -0400, Paul Tilles wrote: > ECPGis_informix_null > > ECPGset_informix_null > > In 8.2.4, I do not see these functions. Instead, I see functions > > ECPGis_noind_null > > ECPGset_noind_null > > Are they functionally the same? Yes. The 7.4 version had some naming

Re: [GENERAL] PgpoolAdmin installation

2007-09-25 Thread Devrim GÜNDÜZ
Hi, On Tue, 2007-09-25 at 14:53 +0530, Ashish Karalkar wrote: > "step 5 ) It accesses install/phpinfo.php from Web a browser. It is > confirmed that the function of php_mstring and php_pgsql is effective. > a.. "Multibyte Support" is "enabled". > b.. "PostgreSQL Support" is "enabled". " > >

[GENERAL] lowering impact of checkpoints

2007-09-25 Thread hubert depesz lubaczewski
hi, our system is handling between 600 and 2000 transactions per second. all of them are very small, very fast. typical query runs in under 1ms. yes - sometimes we get queries that take longer than then should get. simple check shows that we have a very visible pattern of every-5-minutes peak. in t

Re: [GENERAL] PgpoolAdmin installation

2007-09-25 Thread Ashish Karalkar
Thanks for your replay, Previously I have installed pgpool and trying to install pgpoolAdmin. Now I have installed pgpool-II and that problem is sloved. Now I am facing another problem in installation document it is said ; "step 5 ) It accesses install/phpinfo.php from Web a browser. It is c

Re: [GENERAL] "not in" clause too slow?

2007-09-25 Thread Martijn van Oosterhout
On Fri, Sep 21, 2007 at 12:09:50PM +0200, Ottavio Campana wrote: > 2) how can I speed it up? by using indexes? or by changing the query? Note that NOT IN cannot be optimised in the same way as NOT EXISTS due to the different ways they handle NULL. In particular if the subquery of the NOT IN produc

Re: [GENERAL] "not in" clause too slow?

2007-09-25 Thread Ottavio Campana
Alban Hertroys ha scritto: > Ottavio Campana wrote: >> 2) how can I speed it up? by using indexes? or by changing the query? > > Do you have indices on mytable.id and copy_mytable.id? > Does using NOT EXISTS get you any better results? Eventually I had to select not all the table fields but only

Re: [GENERAL] PgpoolAdmin installation

2007-09-25 Thread Devrim GÜNDÜZ
Hi, On Tue, 2007-09-25 at 12:57 +0530, Ashish Karalkar wrote: > can anybody please tell me what is this PCP and PCP directory, I dont > have that one on my box,do i have to install this pcp package and if > yes please point me to the link? Did you install pgpool-II ? Regards, -- Devrim GÜNDÜZ

Re: [GENERAL] UNIQUE_VIOLATION exception, finding out which index would have been violated

2007-09-25 Thread Michael Fuhr
On Tue, Sep 25, 2007 at 04:55:37AM -0200, Petri Simolin wrote: > I have created a function which inserts a row in a table which has 2 unique > indexes on two different columns. > > I am wondering, if there is a way in case of UNIQUE_VIOLATION exception to > find out which index would have been vio

[GENERAL] PgpoolAdmin installation

2007-09-25 Thread Ashish Karalkar
Dear list member, I am trying to install pgpooladmin tool and the documantation talks about following parameter pcp_attach_node command pass /usr/local/bin/pcp_attach_node pcp_detach_node command pass /usr/local/bin/pcp_detach_node pcp_node_count command pass /usr/local/bin/

Re: [GENERAL] [Urgent] Regexp_replace question

2007-09-25 Thread Phoenix Kiula
On 25/09/2007, Michael Fuhr <[EMAIL PROTECTED]> wrote: > > How can I remove characters that form a part of regular expressions? > > Why do you want to do that? Because these values were inserted into the DB due to a faulty application. So cleansing was called for. I just ended up doing it with r