Re: [GENERAL] System in Recovery Mode But No Activity

2008-06-20 Thread Scott Marlowe
On Fri, Jun 20, 2008 at 7:56 PM, John Cheng <[EMAIL PROTECTED]> wrote: > I am running postgresql 8.3, I was not aware of the 3 options (smart, > fast, or immediate). So it used the default - "fast". > > The state of the server when I sent this e-mail was that there were > two remaining connections/

Re: [GENERAL] System in Recovery Mode But No Activity

2008-06-20 Thread John Cheng
I am running postgresql 8.3, I was not aware of the 3 options (smart, fast, or immediate). So it used the default - "fast". The state of the server when I sent this e-mail was that there were two remaining connections/postgres subprocesses. I used kill -9 to stop those two subprocesses. Then postg

Re: [GENERAL] System in Recovery Mode But No Activity

2008-06-20 Thread Scott Marlowe
On Fri, Jun 20, 2008 at 7:12 PM, John Cheng <[EMAIL PROTECTED]> wrote: > We had a run away process on our database box that used up all the > physical and all the virtual memory (swap). This caused the RedHat > Linux oom-killer to kill many processes, including some Postgres ones. > Postgres went i

[GENERAL] System in Recovery Mode But No Activity

2008-06-20 Thread John Cheng
We had a run away process on our database box that used up all the physical and all the virtual memory (swap). This caused the RedHat Linux oom-killer to kill many processes, including some Postgres ones. Postgres went into a funky state after that time: 2008-06-20 14:19:10 CDT [unknown] LOG: inv

Re: [GENERAL] Timezone issue - Is it me or is this a massive bug?

2008-06-20 Thread Adrian Klaver
On Friday 20 June 2008 1:19 pm, Collin Peters wrote: > I have a server of which the OS timezone is set to Pacific time > (currently -7). I run the following query on it > > SELECTnow(), now() AT TIME ZONE 'GMT+10:00', now() AT TIME ZONE > 'GMT-10:00', now() AT TIME ZONE 'Australia/Melbourn

Re: [GENERAL] Forcibly vacating locks

2008-06-20 Thread Bruce Momjian
Laurent Birtz wrote: > > No. The closest thing we have is log_lock_waits in 8.3. I wonder if > > you could hack up something to monitor the server logs for such messages > > and cancel the queries. > > Assuming I can monitor the logs in this way, how would I cancel the > queries (or lack thereo

[GENERAL] Timezone issue - Is it me or is this a massive bug?

2008-06-20 Thread Collin Peters
I have a server of which the OS timezone is set to Pacific time (currently -7). I run the following query on it SELECT now(), now() AT TIME ZONE 'GMT+10:00', now() AT TIME ZONE 'GMT-10:00', now() AT TIME ZONE 'Australia/Melbourne' I would expect this to return: * column 1 - the current time in

Re: [GENERAL] test aggregate functions without a dummy table

2008-06-20 Thread Michael Fuhr
On Fri, Jun 20, 2008 at 10:11:08AM -0400, Tom Lane wrote: > "Willy-Bas Loos" <[EMAIL PROTECTED]> writes: > > I want to test the behavior of an an aggregate without creating a dummy > > table for it. > > But the code for it is horrible. > > Is there no simpler way? > > > select max(foo) > > from (s

Re: [GENERAL] Connection to second database on server

2008-06-20 Thread Scott Marlowe
On Fri, Jun 20, 2008 at 8:06 AM, Bill Moran <[EMAIL PROTECTED]> wrote: > In response to Hermann Muster <[EMAIL PROTECTED]>: > >> Hello everyone, >> >> I already asked about that a couple of days ago, but didn't get an >> satisfying solution for my problem which is following: >> >> I need to create

Re: [GENERAL] test aggregate functions without a dummy table

2008-06-20 Thread Tom Lane
"Willy-Bas Loos" <[EMAIL PROTECTED]> writes: > I want to test the behavior of an an aggregate without creating a dummy > table for it. > But the code for it is horrible. > Is there no simpler way? > select max(foo) > from (select 1 as foo union select 2 as foo)bar; Perhaps VALUES? regression=# s

Re: [GENERAL] Connection to second database on server

2008-06-20 Thread Bill Moran
In response to Hermann Muster <[EMAIL PROTECTED]>: > Hello everyone, > > I already asked about that a couple of days ago, but didn't get an > satisfying solution for my problem which is following: > > I need to create a view that does a query on a second database on the > same PostgreSQL serve

Re: [GENERAL] Connection to second database on server

2008-06-20 Thread Julius Tuskenis
Hi, Hermann. The best solution in my opinion would be using users name and password to connect to database. That way you can decide (grant) what tables can be accessed by this user and there is no password you have to hide from him (or others). So use stored procedure returning set of records

Re: [GENERAL] A plpgsql unidentifiable problem.

2008-06-20 Thread Igor Neyman
Easy: you've got 3 Ifs without "END IF": IF uppergt = 'BOD' THEN RETURN 0 ; IF uppergt = 'MOD' THEN RETURN 86400/2 ; IF uppergt = 'EOD' THEN RETURN 86399 ; Igor -Original Message- From: Ralph Smith [mailto:[EMAIL PROTECTED] Sent: Thursday, June 19, 2008 3:19 PM To: pgsql-general@

[GENERAL] Connection to second database on server

2008-06-20 Thread Hermann Muster
Hello everyone, I already asked about that a couple of days ago, but didn't get an satisfying solution for my problem which is following: I need to create a view that does a query on a second database on the same PostgreSQL server. dblink seems to be the only (???) solution for doing so. The

Re: [GENERAL] Easiest way to copy table from one db to another?

2008-06-20 Thread Kynn Jones
On Wed, Jun 18, 2008 at 4:08 PM, Scott Marlowe <[EMAIL PROTECTED]> wrote: > On Wed, Jun 18, 2008 at 1:48 PM, Kynn Jones <[EMAIL PROTECTED]> wrote: > > > > > > What's the simplest way to copy a table from one database to another one > > running on the same server? > > Easiest way to me: > > pg_dump

[GENERAL] How to UPDATE in ROW-style?

2008-06-20 Thread Dmitry Koterov
Hello. How could I write something like: DECLARE r table%ROWTYPE; ... UPDATE table SET (table.*) = (SELECT r.*) WHERE id = r.id; *This *syntax is invalid, and I cannot find another proper way to do it without explicit enumeration of table's columns. I don't want to explicitly specify tabl

Re: [GENERAL] renumber table

2008-06-20 Thread Steve Clark
David Spadea wrote: Steve, I'd just like to add that I agree with Scott that this is asking for trouble if the field being renumbered is used as a foreign key somewhere. If you have no way of changing this logic, you should at least look into 'on delete cascade' and 'on update cascade' on you

[GENERAL] test aggregate functions without a dummy table

2008-06-20 Thread Willy-Bas Loos
Hi, I want to test the behavior of an an aggregate without creating a dummy table for it. But the code for it is horrible. Is there no simpler way? select max(foo) from (select 1 as foo union select 2 as foo)bar; thx

Re: [GENERAL] Need to update all entries of one table based on an earlier backup

2008-06-20 Thread Thomas Pundt
On Freitag, 20. Juni 2008, Gregory Williamson wrote: | For reasons best left unmentioned, I need to update entries in a table from | a backup; I need to do all entries. | | For reasons eluding my sleep deprived eyes this fails in every variation I | can think of: | | update foo set foo.foo_name2=fo

Re: [GENERAL] Need to update all entries of one table based on an earlier backup

2008-06-20 Thread Gregory Williamson
Thomas Pundt wrote: > > On Freitag, 20. Juni 2008, Gregory Williamson wrote: <...snip...> > Does > > update foo >set foo.foo_name2 = foo_old.foo_name2 > from foo_old > where foo.foo_id = foo_old.foo_id; > > work for you? Thanks to all for pointing out the FROM clause.! "UPDATE foo se

Re: [GENERAL] Need to update all entries of one table based on an earlier backup

2008-06-20 Thread Markus Wollny
Hi! You're missing a table declaration for the table foo_old. You might try this: update foo set foo.foo_name2= (SELECT foo_old.foo_name2 FROM foo_old where foo.foo_id = foo_old.foo_id); Kind regards Markus Von: [EMAIL PROTECTED] [mailto:[EMAIL

[GENERAL] Need to update all entries of one table based on an earlier backup

2008-06-20 Thread Gregory Williamson
For reasons best left unmentioned, I need to update entries in a table from a backup; I need to do all entries. For reasons eluding my sleep deprived eyes this fails in every variation I can think of: update foo set foo.foo_name2=foo_old.foo_name2 where foo.foo_id = foo_old.foo_id; ERROR: mis