Re: [GENERAL] Problem with reading data from standby server ?

2012-04-20 Thread Condor
On 20.04.2012 22:01, Merlin Moncure wrote: On Fri, Apr 20, 2012 at 3:39 AM, Condor wrote: Hello, when I read binary replication tutorial (http://wiki.postgresql.org/wiki/Binary_Replication_Tutorial) I see on Hot Standby: Hot Standby is identical to Warm Standby, except that the Standby is a

Re: [GENERAL] Explain verbose query with CTE

2012-04-20 Thread Bartosz Dmytrak
2012/4/20 Tom Lane > Will look into it. > > Thanks again for Your time :) Regards, Bartek

Re: [GENERAL] Explain verbose query with CTE

2012-04-20 Thread Tom Lane
Bartosz Dmytrak writes: > This e-mail is reposted form pgadmin support mailing list. This problem > looks like related with postgres not pgAdmin. > [ EXPLAIN VERBOSE yields a "cache lookup failed" error ] Huh, yeah, that's a backend bug all right. I thought at first you might have a catalog-corr

Re: [GENERAL] LOCK TABLE is not allowed in a non-volatile function

2012-04-20 Thread Eliot Gable
On Wed, Apr 18, 2012 at 3:47 PM, Tom Lane wrote: > Eliot Gable writes: > > On Wed, Apr 18, 2012 at 1:01 PM, Tom Lane wrote: > >> However, there still might be an issue, because the CONTEXT trace that > >> you showed certainly seemed to point where you thought it did. > > > After re-reading the

Re: And what about temporary functions? (Was: [GENERAL] How to drop a temporary view?)

2012-04-20 Thread Tom Lane
Vincenzo Romano writes: > Why not using the implicit pg_temp_nnn as seen in views and tables? That's intentional, it was considered too much of a security risk to let temporary functions mask normal ones. regards, tom lane -- Sent via pgsql-general mailing list (pgsql-g

Re: [GENERAL] pgstat wait timeout

2012-04-20 Thread Fujii Masao
On Thu, Apr 19, 2012 at 3:32 AM, Efraín Déctor wrote: > Hello list: > > Today I started to see this messages on the PostgreSQL log: > > 2012-04-18 00:01:05 UTC : @  :WARNING:  01000: pgstat wait timeout > 2012-04-18 00:01:05 UTC : @  :LOCATION:  backend_read_statsfile, > pgstat.c:3807 > > I search

And what about temporary functions? (Was: [GENERAL] How to drop a temporary view?)

2012-04-20 Thread Vincenzo Romano
2012/4/20 Tom Lane : > Vincenzo Romano writes: >> The weirdness is that it doesn't produce any notice the first two times. >> At the third invocation I see the notice coming out. > > I'd suggest tweaking the exception handler to print the error it caught; > that would probably clarify what is happ

Re: [GENERAL] pg_basebackup issues

2012-04-20 Thread Magnus Hagander
On Fri, Apr 20, 2012 at 19:51, Lonni J Friedman wrote: > Greetings, > I'm running postgresql-9.1.3 on a Linux-x86_64 (Fedora16, if it > matters) system.  I noticed the existence of pg_basebackup starting in > 9.1, and figured I'd try it out and see if it would simplify our > backup & management pr

Re: [GENERAL] Problem with reading data from standby server ?

2012-04-20 Thread Merlin Moncure
On Fri, Apr 20, 2012 at 3:39 AM, Condor wrote: > Hello, > > when I read binary replication tutorial > (http://wiki.postgresql.org/wiki/Binary_Replication_Tutorial) I see on Hot > Standby: Hot Standby is identical to Warm Standby, except that the Standby > is available to run read-only queries. > I

Re: [GENERAL] pg_advisory_lock() and row deadlocks

2012-04-20 Thread Chris Angelico
On Sat, Apr 21, 2012 at 2:25 AM, Eliot Gable wrote: > How do you control the order in which cascading deletes occur across tables > and the order in which they fire the triggers which do the locking? Well, I'd guess that they probably have a well-defined order. However... > Within a single funct

Re: [GENERAL] How to drop a temporary view?

2012-04-20 Thread Tom Lane
Vincenzo Romano writes: > The weirdness is that it doesn't produce any notice the first two times. > At the third invocation I see the notice coming out. I'd suggest tweaking the exception handler to print the error it caught; that would probably clarify what is happening.

Re: [GENERAL] How to drop a temporary view?

2012-04-20 Thread Vincenzo Romano
2012/4/20 Tom Lane : > Vincenzo Romano writes: >>> As you can see, the third time I get a NOTICE message I don't get the >>> first two times. >>> Everything works fine but this strange thing... > >> There's a typo (extra create temporary view), Sorry, > > Hm, yeah, the first time would throw an er

[GENERAL] pg_basebackup issues

2012-04-20 Thread Lonni J Friedman
Greetings, I'm running postgresql-9.1.3 on a Linux-x86_64 (Fedora16, if it matters) system. I noticed the existence of pg_basebackup starting in 9.1, and figured I'd try it out and see if it would simplify our backup & management processes. I setup a test system (same OS & postgresql version as p

Re: [GENERAL] Unaccent characters

2012-04-20 Thread Peter Eisentraut
On fre, 2012-04-20 at 09:15 +0100, Thom Brown wrote: > I had a look at the unaccent.rules file and noticed the following > characters aren't properly converted: > > ß (U+00DF) An eszett represents a double-s "SS" but this replaces it > with one "S". Shouldn't this be replace with "SS"? Probably

Re: [GENERAL] How to drop a temporary view?

2012-04-20 Thread Tom Lane
Vincenzo Romano writes: >> As you can see, the third time I get a NOTICE message I don't get the >> first two times. >> Everything works fine but this strange thing... > There's a typo (extra create temporary view), Sorry, Hm, yeah, the first time would throw an error because pg_temp doesn't res

Re: [GENERAL] How to drop a temporary view?

2012-04-20 Thread Vincenzo Romano
2012/4/20 Vincenzo Romano : > 2012/4/20 Vincenzo Romano : >> 2012/4/20 Tom Lane : >>> Vincenzo Romano writes: 2012/4/20 Vincenzo Romano : > 2012/4/20 Tom Lane : >> You might be able to use "DROP VIEW pg_temp.foo", which will either >> drop a temp view of your own session or throw

Re: [GENERAL] How to drop a temporary view?

2012-04-20 Thread Vincenzo Romano
2012/4/20 Vincenzo Romano : > 2012/4/20 Tom Lane : >> Vincenzo Romano writes: >>> 2012/4/20 Vincenzo Romano : 2012/4/20 Tom Lane : > You might be able to use "DROP VIEW pg_temp.foo", which will either > drop a temp view of your own session or throw an error if there is none. >> >>> It

Re: [GENERAL] How to drop a temporary view?

2012-04-20 Thread Vincenzo Romano
2012/4/20 Tom Lane : > Vincenzo Romano writes: >> 2012/4/20 Vincenzo Romano : >>> 2012/4/20 Tom Lane : You might be able to use "DROP VIEW pg_temp.foo", which will either drop a temp view of your own session or throw an error if there is none. > >> It works only if you have created at le

Re: [GENERAL] How to drop a temporary view?

2012-04-20 Thread Merlin Moncure
On Fri, Apr 20, 2012 at 11:07 AM, Tom Lane wrote: > Merlin Moncure writes: >> well, arguably you should already know somehow.  but if you don't, >> query information_schema.views for a table_name with a table_schema >> LIKE 'pg_temp%'. > > Not sure that is safe --- won't the info schema also show

Re: [GENERAL] How to drop a temporary view?

2012-04-20 Thread Tom Lane
Vincenzo Romano writes: > 2012/4/20 Vincenzo Romano : >> 2012/4/20 Tom Lane : >>> You might be able to use "DROP VIEW pg_temp.foo", which will either >>> drop a temp view of your own session or throw an error if there is none. > It works only if you have created at least one temporary object. > U

Re: [GENERAL] pg_advisory_lock() and row deadlocks

2012-04-20 Thread Merlin Moncure
On Fri, Apr 20, 2012 at 11:25 AM, Eliot Gable wrote: > On Fri, Apr 20, 2012 at 11:46 AM, Chris Angelico wrote: >> >> >> You have a Dining Philosophers Problem. Why can you not control the >> order in which they acquire their locks? That's one of the simplest >> solutions - for instance, all updat

Re: [GENERAL] How to drop a temporary view?

2012-04-20 Thread Vincenzo Romano
2012/4/20 Vincenzo Romano : > 2012/4/20 Tom Lane : >> Merlin Moncure writes: >>> On Fri, Apr 20, 2012 at 10:51 AM, Vincenzo Romano >>> wrote: Ok. That works. How can I know if there's a temporary view with the same name in my session? >> >>> well, arguably you should already know someho

Re: [GENERAL] How to drop a temporary view?

2012-04-20 Thread Vincenzo Romano
2012/4/20 Tom Lane : > Merlin Moncure writes: >> On Fri, Apr 20, 2012 at 10:51 AM, Vincenzo Romano >> wrote: >>> Ok. That works. How can I know if there's a temporary view with the >>> same name in my session? > >> well, arguably you should already know somehow.  but if you don't, >> query inform

Re: [GENERAL] pg_advisory_lock() and row deadlocks

2012-04-20 Thread Eliot Gable
On Fri, Apr 20, 2012 at 11:46 AM, Chris Angelico wrote: > > You have a Dining Philosophers Problem. Why can you not control the > order in which they acquire their locks? That's one of the simplest > solutions - for instance, all update locks are to be acquired in > alphabetical order of table na

Re: [GENERAL] How to drop a temporary view?

2012-04-20 Thread Tom Lane
Merlin Moncure writes: > On Fri, Apr 20, 2012 at 10:51 AM, Vincenzo Romano > wrote: >> Ok. That works. How can I know if there's a temporary view with the >> same name in my session? > well, arguably you should already know somehow. but if you don't, > query information_schema.views for a table

Re: [GENERAL] How to drop a temporary view?

2012-04-20 Thread Merlin Moncure
On Fri, Apr 20, 2012 at 10:51 AM, Vincenzo Romano wrote: > 2012/4/20 Merlin Moncure : >> On Fri, Apr 20, 2012 at 10:36 AM, Vincenzo Romano >> wrote: >>> Hi all. >>> I'd like use a temporary view "to hide" a non-temp one  for some queries. >>> Later I'd need to drop that view in order to "revert t

Re: [GENERAL] How to drop a temporary view?

2012-04-20 Thread Vincenzo Romano
2012/4/20 Merlin Moncure : > On Fri, Apr 20, 2012 at 10:36 AM, Vincenzo Romano > wrote: >> Hi all. >> I'd like use a temporary view "to hide" a non-temp one  for some queries. >> Later I'd need to drop that view in order to "revert to normal operations". >> As there is no "DROP TEMPORARY VIEW ..."

Re: [GENERAL] pg_advisory_lock() and row deadlocks

2012-04-20 Thread Chris Angelico
On Sat, Apr 21, 2012 at 1:27 AM, Eliot Gable wrote: > If I use pg_advisory_lock(), can I lock and unlock a table multiple times in > both transactions without ever needing to worry about them getting > deadlocked on rows? Doing select locks on rows is not an option because they > last until the en

Re: [GENERAL] How to drop a temporary view?

2012-04-20 Thread Merlin Moncure
On Fri, Apr 20, 2012 at 10:36 AM, Vincenzo Romano wrote: > Hi all. > I'd like use a temporary view "to hide" a non-temp one  for some queries. > Later I'd need to drop that view in order to "revert to normal operations". > As there is no "DROP TEMPORARY VIEW ..." I'd be forced to "CREATE OR > REPL

Re: [GENERAL] How to drop a temporary view?

2012-04-20 Thread Rodrigo Gonzalez
On Fri, 20 Apr 2012 17:36:59 +0200 Vincenzo Romano wrote: > Hi all. > I'd like use a temporary view "to hide" a non-temp one for some > queries. Later I'd need to drop that view in order to "revert to > normal operations". As there is no "DROP TEMPORARY VIEW ..." I'd be > forced to "CREATE OR RE

Re: [GENERAL] pg_advisory_lock() and row deadlocks

2012-04-20 Thread Merlin Moncure
On Fri, Apr 20, 2012 at 10:27 AM, Eliot Gable wrote: > Is it possible to prevent row deadlocks by using pg_advisory_lock()? For > example: > > Transaction 1 grabs pg_advisory_lock(1) > Transaction 1 runs a statement that updates multiple rows on Table A > Transaction 1 releases pg_advisory_lock(1)

[GENERAL] How to drop a temporary view?

2012-04-20 Thread Vincenzo Romano
Hi all. I'd like use a temporary view "to hide" a non-temp one for some queries. Later I'd need to drop that view in order to "revert to normal operations". As there is no "DROP TEMPORARY VIEW ..." I'd be forced to "CREATE OR REPLACE TEMPORARY VIEW ..." in order to "overwrite" the temporary one wi

[GENERAL] pg_advisory_lock() and row deadlocks

2012-04-20 Thread Eliot Gable
Is it possible to prevent row deadlocks by using pg_advisory_lock()? For example: Transaction 1 grabs pg_advisory_lock(1) Transaction 1 runs a statement that updates multiple rows on Table A Transaction 1 releases pg_advisory_lock(1) Transaction 1 continues processing other stuff Transaction 1 gra

Re: [GENERAL] Why did pg_relation_filepath does not give a correct path ?

2012-04-20 Thread F. BROUARD / SQLpro
Le 20/04/2012 16:18, Guillaume Lelarge a écrit : SELECT CASE WHEN coalesce(t.spclocation, '') = '' THEN current_setting('data_directory')||'/'||pg_relation_filepath(c.oid) ELSE replace(pg_relation_filepath(c.oid), 'pg_tblspc/'||t.oid::text,

Re: [GENERAL] Why did pg_relation_filepath does not give a correct path ?

2012-04-20 Thread Guillaume Lelarge
On Fri, 2012-04-20 at 14:47 +0200, F. BROUARD / SQLpro wrote: > Le 20/04/2012 12:05, Guillaume Lelarge a écrit : > > On Fri, 2012-04-20 at 11:35 +0200, F. BROUARD / SQLpro wrote: > >> Hi, > >> > >> according to the documentation, the function pg_relation_filepath > >> "returns the entire file path

Re: [GENERAL] Why did pg_relation_filepath does not give a correct path ?

2012-04-20 Thread F. BROUARD / SQLpro
Le 20/04/2012 12:05, Guillaume Lelarge a écrit : On Fri, 2012-04-20 at 11:35 +0200, F. BROUARD / SQLpro wrote: Hi, according to the documentation, the function pg_relation_filepath "returns the entire file path name (relative to the database cluster's data directory PGDATA) of the relation" Wh

Re: [GENERAL] Money in numeric field

2012-04-20 Thread Martín Marqués
El día 20 de abril de 2012 05:51, Albe Laurenz escribió: > Martín Marqués wrote: >> I have a question involving money data stored in a numeric(9,2) field, >> and posible errors with there manipulation. >> >> in short, the table has these columns: >> >> store: int >> amount: int2 >> cost: numeric(9

Re: [GENERAL] Why did pg_relation_filepath does not give a correct path ?

2012-04-20 Thread Guillaume Lelarge
On Fri, 2012-04-20 at 11:35 +0200, F. BROUARD / SQLpro wrote: > Hi, > > according to the documentation, the function pg_relation_filepath > "returns the entire file path name (relative to the database cluster's > data directory PGDATA) of the relation" > > When my table are located in the pg_def

[GENERAL] Why did pg_relation_filepath does not give a correct path ?

2012-04-20 Thread F. BROUARD / SQLpro
Hi, according to the documentation, the function pg_relation_filepath "returns the entire file path name (relative to the database cluster's data directory PGDATA) of the relation" When my table are located in the pg_default tablespace, the gievn relative path is correct When my table are l

Re: [GENERAL] Money in numeric field

2012-04-20 Thread Albe Laurenz
Martín Marqués wrote: > I have a question involving money data stored in a numeric(9,2) field, > and posible errors with there manipulation. > > in short, the table has these columns: > > store: int > amount: int2 > cost: numeric(9,2) > > What I need to find is the total amount of money spent in

Re: [GENERAL] Problem with reading data from standby server ?

2012-04-20 Thread Richard Huxton
On 20/04/12 09:39, Condor wrote: Hello, when I read binary replication tutorial (http://wiki.postgresql.org/wiki/Binary_Replication_Tutorial) I see on Hot Standby: Hot Standby is identical to Warm Standby, except that the Standby is available to run read-only queries. I setup hot standby server

[GENERAL] Problem with reading data from standby server ?

2012-04-20 Thread Condor
Hello, when I read binary replication tutorial (http://wiki.postgresql.org/wiki/Binary_Replication_Tutorial) I see on Hot Standby: Hot Standby is identical to Warm Standby, except that the Standby is available to run read-only queries. I setup hot standby server described in tutorial and it's

[GENERAL] Unaccent characters

2012-04-20 Thread Thom Brown
Hi, I had a look at the unaccent.rules file and noticed the following characters aren't properly converted: ß (U+00DF) An eszett represents a double-s "SS" but this replaces it with one "S". Shouldn't this be replace with "SS"? Æ (U+00C6) and æ (U+00E6) These doesn't have an accent, diacritic