[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 or

[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

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

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 a

[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

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_default

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 laurenz.a...@wien.gv.at 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:

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

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 name (relative

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,

[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

[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 with the

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 egable+pgsql-gene...@gmail.com 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

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 vincenzo.rom...@notorand.it 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

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 vincenzo.rom...@notorand.it 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

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 egable+pgsql-gene...@gmail.com 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

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

2012-04-20 Thread Vincenzo Romano
2012/4/20 Merlin Moncure mmonc...@gmail.com: On Fri, Apr 20, 2012 at 10:36 AM, Vincenzo Romano vincenzo.rom...@notorand.it 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

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 vincenzo.rom...@notorand.it wrote: 2012/4/20 Merlin Moncure mmonc...@gmail.com: On Fri, Apr 20, 2012 at 10:36 AM, Vincenzo Romano vincenzo.rom...@notorand.it wrote: Hi all. I'd like use a temporary view to hide a non-temp one  for some

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

2012-04-20 Thread Tom Lane
Merlin Moncure mmonc...@gmail.com writes: On Fri, Apr 20, 2012 at 10:51 AM, Vincenzo Romano vincenzo.rom...@notorand.it 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,

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 ros...@gmail.com 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

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

2012-04-20 Thread Vincenzo Romano
2012/4/20 Tom Lane t...@sss.pgh.pa.us: Merlin Moncure mmonc...@gmail.com writes: On Fri, Apr 20, 2012 at 10:51 AM, Vincenzo Romano vincenzo.rom...@notorand.it 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

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

2012-04-20 Thread Vincenzo Romano
2012/4/20 Vincenzo Romano vincenzo.rom...@notorand.it: 2012/4/20 Tom Lane t...@sss.pgh.pa.us: Merlin Moncure mmonc...@gmail.com writes: On Fri, Apr 20, 2012 at 10:51 AM, Vincenzo Romano vincenzo.rom...@notorand.it wrote: Ok. That works. How can I know if there's a temporary view with the

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 egable+pgsql-gene...@gmail.com wrote: On Fri, Apr 20, 2012 at 11:46 AM, Chris Angelico ros...@gmail.com 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

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

2012-04-20 Thread Tom Lane
Vincenzo Romano vincenzo.rom...@notorand.it writes: 2012/4/20 Vincenzo Romano vincenzo.rom...@notorand.it: 2012/4/20 Tom Lane t...@sss.pgh.pa.us: 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 Merlin Moncure
On Fri, Apr 20, 2012 at 11:07 AM, Tom Lane t...@sss.pgh.pa.us wrote: Merlin Moncure mmonc...@gmail.com 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 ---

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

2012-04-20 Thread Vincenzo Romano
2012/4/20 Tom Lane t...@sss.pgh.pa.us: Vincenzo Romano vincenzo.rom...@notorand.it writes: 2012/4/20 Vincenzo Romano vincenzo.rom...@notorand.it: 2012/4/20 Tom Lane t...@sss.pgh.pa.us: You might be able to use DROP VIEW pg_temp.foo, which will either drop a temp view of your own session or

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

2012-04-20 Thread Vincenzo Romano
2012/4/20 Vincenzo Romano vincenzo.rom...@notorand.it: 2012/4/20 Tom Lane t...@sss.pgh.pa.us: Vincenzo Romano vincenzo.rom...@notorand.it writes: 2012/4/20 Vincenzo Romano vincenzo.rom...@notorand.it: 2012/4/20 Tom Lane t...@sss.pgh.pa.us: You might be able to use DROP VIEW pg_temp.foo, which

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

2012-04-20 Thread Vincenzo Romano
2012/4/20 Vincenzo Romano vincenzo.rom...@notorand.it: 2012/4/20 Vincenzo Romano vincenzo.rom...@notorand.it: 2012/4/20 Tom Lane t...@sss.pgh.pa.us: Vincenzo Romano vincenzo.rom...@notorand.it writes: 2012/4/20 Vincenzo Romano vincenzo.rom...@notorand.it: 2012/4/20 Tom Lane

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

2012-04-20 Thread Tom Lane
Vincenzo Romano vincenzo.rom...@notorand.it 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

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, but it

[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

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

2012-04-20 Thread Vincenzo Romano
2012/4/20 Tom Lane t...@sss.pgh.pa.us: Vincenzo Romano vincenzo.rom...@notorand.it 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,

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

2012-04-20 Thread Tom Lane
Vincenzo Romano vincenzo.rom...@notorand.it 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

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 egable+pgsql-gene...@gmail.com 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.

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 con...@stz-bg.com 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

Re: [GENERAL] pg_basebackup issues

2012-04-20 Thread Magnus Hagander
On Fri, Apr 20, 2012 at 19:51, Lonni J Friedman netll...@gmail.com 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

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

2012-04-20 Thread Vincenzo Romano
2012/4/20 Tom Lane t...@sss.pgh.pa.us: Vincenzo Romano vincenzo.rom...@notorand.it 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;

Re: [GENERAL] pgstat wait timeout

2012-04-20 Thread Fujii Masao
On Thu, Apr 19, 2012 at 3:32 AM, Efraín Déctor efraindec...@motumweb.com 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,

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

2012-04-20 Thread Tom Lane
Vincenzo Romano vincenzo.rom...@notorand.it 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

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 t...@sss.pgh.pa.us wrote: Eliot Gable egable+pgsql-gene...@gmail.com writes: On Wed, Apr 18, 2012 at 1:01 PM, Tom Lane t...@sss.pgh.pa.us wrote: However, there still might be an issue, because the CONTEXT trace that you showed certainly seemed to

Re: [GENERAL] Explain verbose query with CTE

2012-04-20 Thread Tom Lane
Bartosz Dmytrak bdmyt...@gmail.com 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

Re: [GENERAL] Explain verbose query with CTE

2012-04-20 Thread Bartosz Dmytrak
2012/4/20 Tom Lane t...@sss.pgh.pa.us Will look into it. Thanks again for Your time :) Regards, Bartek

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 con...@stz-bg.com 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