Re: [GENERAL] High CPU on read-only streaming replication server

2012-07-19 Thread Nick
On Jul 19, 1:23 pm, Nick wrote: > My read-only streaming replication servers are showing a much higher > CPU load than I would expect. > > None of my queries are longer than 10ms. > > My application server is connecting to this server via pgbouncer. > > Other than that, its a pretty standard setup

[GENERAL] Problem setting environmental variables for postgresql or plpythonu

2012-07-19 Thread Mark Wynter
I''m hoping someone can help me out. I'm wanting to run GRASS GIS from within a plpythonu function block. But to run GRASS GIS externally, the following environmental variables need to be available to the Postgresql server... GISBASE='/usr/local/grass-6.4.3svn' PATH='$PATH:$GISBASE/bin:$GISBA

[GENERAL] postgres 9 bind address for replication

2012-07-19 Thread Adam Crews
Hello, I’m using pg 9.1.3 on CentOS 5 and have a few slave databases setup using the built in streaming replication. On the slaves I set the “listen_addresses” config option to an ip address for a virtual alias on my network interfaces. The host has an address of 10.1.1.10, and there is a virtua

Re: [GENERAL] Default value of serial fields changes after restore

2012-07-19 Thread Tom Lane
Scott Marlowe writes: > On Thu, Jul 19, 2012 at 1:13 PM, Tom Lane wrote: >> This claim is utter nonsense. If you are having a problem it's not due >> to the way regclass literals print. Please show a complete example of >> something failing. > Is it possible the OP has an "alter user set searc

Re: [GENERAL] How to stop a query

2012-07-19 Thread Scott Marlowe
On Thu, Jul 19, 2012 at 3:17 AM, younus wrote: > Hi, > > First : >ps -ef | grep postgres > and kill -9 (PID of your query) NEVER kill -9 a postgres process unless you've exhausted all other possibilities, as it forces a restart of all the other backends as well. A plain kill (no -9) is

Re: [GENERAL] Default value of serial fields changes after restore

2012-07-19 Thread Scott Marlowe
On Thu, Jul 19, 2012 at 1:13 PM, Tom Lane wrote: > Luiz Damim writes: >> After restore, default_value changes to >> nextval('testtable_id_seq'::regclass) and INSERT's start to fail as the >> sequence can´t be found on it's schema. > > This claim is utter nonsense. If you are having a problem it'

Re: [GENERAL] Default value of serial fields changes after restore

2012-07-19 Thread Tom Lane
Luiz Damim writes: > Today I found a strange behavior after restoring a PostgreSQL database: the > schema of all serialfields default values are trimmed out. I don't think anything's being "trimmed out". It's the normal behavior of regclass literals to not print the schema if the table (or seque

Re: [GENERAL] Trouble with NEW

2012-07-19 Thread Adrian Klaver
On 07/19/2012 11:26 AM, David Johnston wrote: 4) If you want to pull information from another table, you either need to set up a FOREIGN KEY relationship that you can leverage or you need to do a query in the trigger function that pulls in the necessary information. I do not get where the "OR

Re: [GENERAL] Trouble with NEW

2012-07-19 Thread David Johnston
> > 4) If you want to pull information from another table, you either need to set > up a FOREIGN KEY relationship that you can leverage or you need to do a > query in the trigger function that pulls in the necessary information. > I do not get where the "OR" comes from. There is nothing magical

[GENERAL] Default value of serial fields changes after restore

2012-07-19 Thread Luiz Damim
Today I found a strange behavior after restoring a PostgreSQL database: the schema of all serialfields default values are trimmed out. For example: CREATE TABLE testschema.testtable ( id serial, name character varying(255), CONSTRAINT pk_testtable PRIMARY KEY (id) ) WITH ( OIDS = FALSE

Re: [GENERAL] Trouble with NEW

2012-07-19 Thread Adrian Klaver
On 07/19/2012 08:41 AM, Bob Pawley wrote: In all my reading of new and old I never made that connection. It makes more sense if you know what NEW and OLD represent. What follows is a simplification: 1)Postgres uses Multiversion Concurrency Control(MVCC). See here for brief intro: http://www.

Re: [GENERAL] How to stop a query

2012-07-19 Thread Younus
Hi Scott, thank you for your comment 2012/7/19 Scott Marlowe > On Thu, Jul 19, 2012 at 3:17 AM, younus wrote: > > Hi, > > > > First : > >ps -ef | grep postgres > > and kill -9 (PID of your query) > > NEVER kill -9 a postgres process unless you've exhausted all other > possibilities,

Re: [GENERAL] How to stop a query

2012-07-19 Thread younus
Hi, Yes, I'm sure, it's work. if you execute query by another program (program java), you must use the first solution [ps -ef | grep postgres and kill -9 (PID of your query)]. if you use pgsql terminal and you're connecting with postgres you can use select procpid, datname, usename, client_ad

Re: [GENERAL] How to stop a query

2012-07-19 Thread Atri Sharma
On Thu, Jul 19, 2012 at 2:47 PM, younus wrote: > Hi, > > First : >ps -ef | grep postgres > and kill -9 (PID of your query) > > Sec : > select procpid, datname, usename, client_addr, current_query from > pg_stat_activity where current_query!=''; > > and > > SELECT pg_cancel_backend(procpi

Re: [GENERAL] Trouble with NEW

2012-07-19 Thread Bob Pawley
In all my reading of new and old I never made that connection. Thanks Adrian Bob -Original Message- From: Adrian Klaver Sent: Thursday, July 19, 2012 6:50 AM To: Bob Pawley Cc: Alan Hodgson ; pgsql-general@postgresql.org Subject: Re: [GENERAL] Trouble with NEW On 07/19/2012 06:4

Re: [GENERAL] Synchronization Master -> Slave

2012-07-19 Thread Sergey Konoplev
Check your hotmail inbox. You have an answer there. On Thu, Jul 19, 2012 at 3:35 PM, Edson Richter wrote: > I've serious problems with slow link between continents, and twice a week > I have to manually reestablish the slave, by running the following script: > > > ---

Re: [GENERAL] Segmentation fault

2012-07-19 Thread Amod Pandey
Thank you Craig for explaining in such a detail. I am adding more information and would see what more I can add, $ulimit -a core file size (blocks, -c) 0 So I assume there to be no core dump file. If I set 'ulimit -c unlimited' will it generate core dump if there is another occurrence.

Re: [GENERAL] How to stop a query

2012-07-19 Thread younus
Hi, First : ps -ef | grep postgres and kill -9 (PID of your query) Sec : select procpid, datname, usename, client_addr, current_query from pg_stat_activity where current_query!=''; and SELECT pg_cancel_backend(procpid); younus, -- View this message in context: http://postgresql.

[GENERAL] Synchronization Master -> Slave

2012-07-19 Thread Edson Richter
I've serious problems with slow link between continents, and twice a week I have to manually reestablish the slave, by running the following script: --

Re: [GENERAL] GENERATED columns

2012-07-19 Thread Tom Lane
Daniel McGreal writes: > In my searching I found several references (in pg-hackers, circa 2007) > concerning the implementation of the SQL:2003 GENERATED column features. > This does not seem to have made it into release? Any plans, etc? AFAIK nobody is working on such a feature currently. If me

Re: [GENERAL] Trouble with NEW

2012-07-19 Thread Adrian Klaver
On 07/19/2012 06:43 AM, Bob Pawley wrote: The function is too long to copy. I separated it into another trigger function with just the update statement. Here is the error - ERROR: record "new" has no field "fluid_id" SQL state: 42703 Context: SQL statement "update p_id.fluids set fluid_sho

Re: [GENERAL] Trouble with NEW

2012-07-19 Thread Bob Pawley
The function is too long to copy. I separated it into another trigger function with just the update statement. Here is the error - ERROR: record "new" has no field "fluid_id" SQL state: 42703 Context: SQL statement "update p_id.fluids set fluid_short = (select shape.text from shape, n

[GENERAL] Handling error during async query

2012-07-19 Thread Daniele Varrazzo
Hello, I'm trying to fix psycopg2 issue #113: network disconnection not handled correctly in async mode. If I'm in the middle between the PQsendQuery and the PQgetResult and an error is detected (let's say we don't know yet if application-related or connection-related), is there a way to abort th

Re: [GENERAL] problem with dblink and "drop owned by"

2012-07-19 Thread James W. Wilson
OK, understood, thanks. On Wed, Jul 18, 2012 at 10:15 PM, Tom Lane wrote: > "James W. Wilson" writes: >> I'm confused. I thought foreign data wrappers were required to create >> database links from one Postgresql server to another. > > contrib/dblink doesn't require them. It does have an option

Re: [GENERAL] [BUGS] main log encoding problem

2012-07-19 Thread Craig Ringer
On 07/19/2012 04:58 PM, Alban Hertroys wrote: On 19 July 2012 10:40, Alexander Law wrote: Ok, maybe the time of real universal encoding has not yet come. Then we maybe just should add a new parameter "log_encoding" (UTF-8 by default) to postgresql.conf. And to use this encoding consistently wit

Re: [GENERAL] [BUGS] main log encoding problem

2012-07-19 Thread Craig Ringer
On 07/19/2012 03:24 PM, Tatsuo Ishii wrote: BTW, I'm not stick with mule-internal encoding. What we need here is a "super" encoding which could include any existing encodings without information loss. For this purpose, I think we can even invent a new encoding(maybe something like very first prpo

Re: [GENERAL] Synchronization Master -> Slave (on slow connetion)

2012-07-19 Thread Sergey Konoplev
On Thu, Jul 19, 2012 at 4:27 PM, Sergey Konoplev wrote: > On Thu, Jul 19, 2012 at 3:45 PM, Edson Richter > wrote: >> The rsync above can be optimized? Both servers are CentOS 5 with OpenVPN > > Yes, it can be optimized. You can turn compression on by specifying > -z. The compression level 1 is t

Re: [GENERAL] Synchronization Master -> Slave (on slow connetion)

2012-07-19 Thread Sergey Konoplev
On Thu, Jul 19, 2012 at 3:45 PM, Edson Richter wrote: > The rsync above can be optimized? Both servers are CentOS 5 with OpenVPN Yes, it can be optimized. You can turn compression on by specifying -z. The compression level 1 is the one that performs best for my needs. You can find out yours best

Re: [GENERAL] [BUGS] main log encoding problem

2012-07-19 Thread Alban Hertroys
On 19 July 2012 13:50, Alexander Law wrote: >> I like Craig's idea of adding the client encoding to the log lines. A >> possible problem with that (I'm not an encoding expert) is that a log >> line like that will contain data about the database server meta-data >> (log time, client encoding, etc)

Re: [GENERAL] [BUGS] main log encoding problem

2012-07-19 Thread Alexander Law
I like Craig's idea of adding the client encoding to the log lines. A possible problem with that (I'm not an encoding expert) is that a log line like that will contain data about the database server meta-data (log time, client encoding, etc) in the database default encoding and database data (the

[GENERAL] Synchronization Master -> Slave (on slow connetion)

2012-07-19 Thread Edson Richter
I've serious problems with slow link between continents, and twice a week I have to manually reestablish the slave, by running the following script: -- psql -

Re: [GENERAL] [BUGS] main log encoding problem

2012-07-19 Thread Alexander Law
Sorry, it was inaccurate phrase. I mean "if the conversion to this encoding is not avaliable". For example, when we have database in EUC_JP and log_encoding set to Latin1. I think that we can even fall back to UTF-8 as we can convert all encodings to it (with some exceptions that you noticed).

Re: [GENERAL] [BUGS] main log encoding problem

2012-07-19 Thread Alban Hertroys
Yikes, messed up my grammar a bit I see! On 19 July 2012 10:58, Alban Hertroys wrote: > I like Craig's idea of adding the client encoding to the log lines. A > possible problem with that (I'm not an encoding expert) is that a log > line like that will contain data about the database server meta-

Re: [GENERAL] [BUGS] main log encoding problem

2012-07-19 Thread Alban Hertroys
On 19 July 2012 10:40, Alexander Law wrote: >>> Ok, maybe the time of real universal encoding has not yet come. Then >>> we maybe just should add a new parameter "log_encoding" (UTF-8 by >>> default) to postgresql.conf. And to use this encoding consistently >>> within logging_collector. >>> If thi

Re: [GENERAL] [BUGS] main log encoding problem

2012-07-19 Thread Tatsuo Ishii
> Sorry, it was inaccurate phrase. I mean "if the conversion to this > encoding is not avaliable". For example, when we have database in > EUC_JP and log_encoding set to Latin1. I think that we can even fall > back to UTF-8 as we can convert all encodings to it (with some > exceptions that you noti

Re: [GENERAL] [BUGS] main log encoding problem

2012-07-19 Thread Alexander Law
Ok, maybe the time of real universal encoding has not yet come. Then we maybe just should add a new parameter "log_encoding" (UTF-8 by default) to postgresql.conf. And to use this encoding consistently within logging_collector. If this encoding is not available then fall back to 7-bit ASCII. What

Re: [GENERAL] [BUGS] main log encoding problem

2012-07-19 Thread Tatsuo Ishii
>> You can google by "encoding "EUC_JP" has no equivalent in "UTF8"" or >> some such to find such an example. In this case PostgreSQL just throw >> an error. For frontend/backend encoding conversion this is fine. But >> what should we do for logs? Apparently we cannot throw an error here. >> >> "Un

Re: [GENERAL] [BUGS] main log encoding problem

2012-07-19 Thread Alexander Law
And regarding mule internal encoding - reading about Mule http://www.emacswiki.org/emacs/UnicodeEncoding I found: /In future (probably Emacs 22), Mule will use an internal encoding which is a UTF-8 encoding of a superset of Unicode. / So I still see UTF-8 as a common denominator for all the enco

Re: [GENERAL] [BUGS] main log encoding problem

2012-07-19 Thread Alexander Law
The initial issue was that log file contains messages in different encodings. So transcoding is performed already, but it's not This is not true. Transcoding happens only when PostgreSQL is built with --enable-nls option (default is no nls). I'll restate the initial issue as I see it. I have Win

[GENERAL] GENERATED columns

2012-07-19 Thread Daniel McGreal
Hi, In my searching I found several references (in pg-hackers, circa 2007) concerning the implementation of the SQL:2003 GENERATED column features. This does not seem to have made it into release? Any plans, etc? Dan.

Re: [GENERAL] [BUGS] main log encoding problem

2012-07-19 Thread Tatsuo Ishii
> Hello, >> >> Implementing any of these isn't trivial - especially making sure >> messages emitted to stderr from things like segfaults and dynamic >> linker messages are always correct. Ensuring that the logging >> collector knows when setlocale() has been called to change the >> encoding and tra

Re: [GENERAL] [BUGS] main log encoding problem

2012-07-19 Thread Tatsuo Ishii
>> I am thinking about variant of C. >> >> Problem with C is, converting from other encoding to UTF-8 is not >> cheap because it requires huge conversion tables. This may be a >> serious problem with busy server. Also it is possible some information >> is lossed while in this conversion. This is be

Re: [GENERAL] main log encoding problem

2012-07-19 Thread Alexander Law
Hello, Implementing any of these isn't trivial - especially making sure messages emitted to stderr from things like segfaults and dynamic linker messages are always correct. Ensuring that the logging collector knows when setlocale() has been called to change the encoding and translation of s