Re: [GENERAL] Backups over slave instead master?

2014-05-16 Thread chiru r
Hi , Yes, It is possible to execute backups on the slave server instead of master. Below are the steps we run for one of our past customer every day to refresh his Dev/test environments using slave backups. *On Slave:* 1. Pause the replication postgres=# select pg_xlog_replay_pause();

[GENERAL] Psycopg2 : error message.

2014-05-16 Thread image
Dear all, I'm writing a python script for a web service. I have to connect to my postgres/postgis databases via Psycopg2. I writed a little first script just to connect to my pg/postgis db and drop a test db. But when i execute the python file, i have several error messages. Please read the 2

Re: [GENERAL] Psycopg2 : error message.

2014-05-16 Thread Dorian Hoxha
Try to use: dont catch the exception when you make the connection, to see the right error because: i am unable to connect may mean different things: 1.wrong user 2.wrong pass 3.server down etc On Fri, May 16, 2014 at 12:12 PM, image lcel...@latitude-geosystems.comwrote: Dear all, I'm

Re: [GENERAL] Psycopg2 : error message.

2014-05-16 Thread image
Hello, Thanks. Ok i deleted the except. Please find below the 2 updates usefull liles : pg_test.py http://postgresql.1045698.n5.nabble.com/file/n5804203/pg_test.py SS_dos.JPG http://postgresql.1045698.n5.nabble.com/file/n5804203/SS_dos.JPG In advance, thank you. Regards. IMAGE.

Re: [GENERAL] Psycopg2 : error message.

2014-05-16 Thread Dorian Hoxha
Also remove the first try + remove the space before conn= so you have this: #!/Python27/python.exe import psycopg2 # Try to connect conn=psycopg2.connect(dbname='busard_test' user='laurent' host='localhost' password='cactus') cur = conn.cursor() On Fri, May 16, 2014 at 12:41 PM,

Re: [GENERAL] Psycopg2 : error message.

2014-05-16 Thread Karsten Hilbert
On Fri, May 16, 2014 at 03:41:15AM -0700, image wrote: Thanks. Ok i deleted the except. Please find below the 2 updates usefull liles : pg_test.py http://postgresql.1045698.n5.nabble.com/file/n5804203/pg_test.py You need to learn to write proper Python code, especially try: except:

Re: [GENERAL] TODO: Expose parser support for decoding unicode escape literals to user

2014-05-16 Thread Craig Ringer
On 05/15/2014 09:56 PM, Adrian Klaver wrote: test= SELECT quote_literal(E'test \u011B'); quote_literal --- 'test ě' That's another case where the function isn't doing what you expect. quote_literal has nothing to do with what's happening, it's escape-string processing in the

Re: [GENERAL] Psycopg2 : error message.

2014-05-16 Thread image
Thanks for your help. So i remove the first try + i remove the space before conn= Indeed i have a new error message in my DOS interface : pg_test.py http://postgresql.1045698.n5.nabble.com/file/n5804207/pg_test.py SS_dos.JPG http://postgresql.1045698.n5.nabble.com/file/n5804207/SS_dos.JPG

Re: [GENERAL] Psycopg2 : error message.

2014-05-16 Thread Dorian Hoxha
Since I can't understand(french?) the language, what does it mean? Probably wrong authentication(password?). On Fri, May 16, 2014 at 1:19 PM, image lcel...@latitude-geosystems.comwrote: Thanks for your help. So i remove the first try + i remove the space before conn= Indeed i have a new

Re: [GENERAL] Psycopg2 : error message.

2014-05-16 Thread Karsten Hilbert
On Fri, May 16, 2014 at 04:19:25AM -0700, image wrote: Indeed i have a new error message in my DOS interface : pg_test.py http://postgresql.1045698.n5.nabble.com/file/n5804207/pg_test.py SS_dos.JPG http://postgresql.1045698.n5.nabble.com/file/n5804207/SS_dos.JPG You'll have to

Re: [GENERAL] Psycopg2 : error message.

2014-05-16 Thread Karsten Hilbert
You need to search the web for how and whether to quote values inside the DSN for psycopg2. Karsten -- GPG key ID E4071346 @ gpg-keyserver.de E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346 -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

Re: [GENERAL] TODO: Expose parser support for decoding unicode escape literals to user

2014-05-16 Thread Adrian Klaver
On 05/16/2014 04:12 AM, Craig Ringer wrote: On 05/15/2014 09:56 PM, Adrian Klaver wrote: test= SELECT quote_literal(E'test \u011B'); quote_literal --- 'test ě' That's another case where the function isn't doing what you expect. quote_literal has nothing to do with what's

[GENERAL] pgsql in a virtual environment

2014-05-16 Thread Graeme Gemmill
I am running a postgresql application under Mandriva 2011 x86_64, and want to explore the problems in porting it to a Mageia 4 x86_64 environment before actually upgrading. I have installed Mageia 4 as a virtual machine under VBox, installed postgresql 9.3 and sorted out a shared folder to get

Re: [GENERAL] Psycopg2 : error message.

2014-05-16 Thread Karsten Hilbert
On Fri, May 16, 2014 at 11:07:42AM -0400, skeeved wrote: Looks like you have an invalid connection string: conn=psycopg2.connect(dbname='busard_test' user='laurent' host='localhost' password='cactus’) Try removing the double quotes, they are obscuring the parameter names and values:

Re: [GENERAL] pgsql in a virtual environment

2014-05-16 Thread Martín Marqués
2014-05-16 11:56 GMT-03:00 Graeme Gemmill gra...@gemmill.name: $ ./pg_ctl start -D /mnt/post/pgsql/data [1] 3692 [postgres@localhost bin]$ pg_ctl: could not open PID file /mnt/post/pgsql/data/postmaster.pid: Protocol error [1]+ Exit 1 ./pg_ctl start -D /mnt/post/pgsql/data

Re: [GENERAL] Psycopg2 : error message.

2014-05-16 Thread image
Dear all, Thank you for your replies.Before taking into account your last proposals, I would like to tell you : I noticed that i don't get error message when i use the default user (postgres). But when i use my new user account (laurent), i get the error message. With pgadmin3 i would like edit

Re: [GENERAL] pgsql in a virtual environment

2014-05-16 Thread Tom Lane
=?UTF-8?B?TWFydMOtbiBNYXJxdcOpcw==?= mar...@2ndquadrant.com writes: 2014-05-16 11:56 GMT-03:00 Graeme Gemmill gra...@gemmill.name: $ ./pg_ctl start -D /mnt/post/pgsql/data [1] 3692 [postgres@localhost bin]$ pg_ctl: could not open PID file /mnt/post/pgsql/data/postmaster.pid: Protocol error

[GENERAL] Monitoring Streaming Replication in 9.2

2014-05-16 Thread maillists0
Newb question here. I have streaming replication working with 9.2 and I'm using Bucardo's check_postgres.pl to monitor replication. I see that it runs this query on the slave: SELECT pg_last_xlog_receive_location() AS receive, pg_last_xlog_replay_location() AS replay That returns hex, which is

[GENERAL] Questions about DB capabilities

2014-05-16 Thread Diego Ramón Cando Díaz
Hi, I have a question, is postgres cappable of horizontal growing, I mean, in the case I have a server that is reaching it’s full HD capacity, is there a way to add another server to use as an extensión of ther first one, like a cluster configuration, do you know a configuration that is

[GENERAL] Monitoring Streaming Replication in 9.2

2014-05-16 Thread J Adams
Newb question here. I have streaming replication working with 9.2 and I'm using Bucardo's check_postgres.pl to monitor replication. I see that it runs this query on the slave: SELECT pg_last_xlog_receive_location() AS receive, pg_last_xlog_replay_location() AS replay That returns hex, which is

Re: [GENERAL] Questions about DB capabilities

2014-05-16 Thread John R Pierce
On 5/15/2014 1:52 PM, Diego Ramón Cando Díaz wrote: Hi, I have a question, is postgres cappable of horizontal growing, I mean, in the case I have a server that is reaching it’s full HD capacity, is there a way to add another server to use as an extensión of ther first one, like a cluster

Re: [GENERAL] Monitoring Streaming Replication in 9.2

2014-05-16 Thread dinesh kumar
Hi, Herehttp://eulerto.blogspot.in/2011/11/understanding-wal-nomenclature.htmlis the blog which has good explanation about this. If you want to find the lag in seconds, then you need to execute something like below. SELECT pg_last_xact_replay_timestamp() - now(); Regards, Dinesh

Re: [GENERAL] Psycopg2 : error message.

2014-05-16 Thread Adrian Klaver
On 05/16/2014 08:07 AM, skeeved wrote: Looks like you have an invalid connection string: conn=psycopg2.connect(dbname='busard_test' user='laurent' host='localhost' password='cactus’) Try removing the double quotes, they are obscuring the parameter names and values:

Re: [GENERAL] Psycopg2 : error message.

2014-05-16 Thread Adrian Klaver
On 05/16/2014 08:41 AM, image wrote: Dear all, Thank you for your replies.Before taking into account your last proposals, I would like to tell you : I noticed that i don't get error message when i use the default user (postgres). But when i use my new user account (laurent), i get the error

Re: [GENERAL] Psycopg2 : error message.

2014-05-16 Thread Adrian Klaver
On 05/16/2014 08:41 AM, image wrote: Dear all, Thank you to throw light for me. Hit send to soon. Meant to add that the French version of the manual is available here: http://docs.postgresql.fr/9.3/ Might help with some of the basics. Regards. -- Adrian Klaver

[GENERAL] pg_query_params() problem with date_trunc() (possibly other functions as well)

2014-05-16 Thread patrick keshishian
Hi list, My google skills are very poor, so excuse me if this is documented some place I'm failing to find. I started to look into using pg_query_params() with some php scripts, but ran into this issue where I get: PHP message: PHP Warning: pg_query_params(): Query failed: ERROR: invalid input

Re: [GENERAL] pg_query_params() problem with date_trunc() (possibly other functions as well)

2014-05-16 Thread Tom Lane
patrick keshishian pkesh...@gmail.com writes: I started to look into using pg_query_params() with some php scripts, but ran into this issue where I get: PHP message: PHP Warning: pg_query_params(): Query failed: ERROR: invalid input syntax for type timestamp: $1 LINE 1: ... date_trunc('day',

Re: [GENERAL] pg_query_params() problem with date_trunc() (possibly other functions as well)

2014-05-16 Thread patrick keshishian
On 5/16/14, Tom Lane t...@sss.pgh.pa.us wrote: patrick keshishian pkesh...@gmail.com writes: I started to look into using pg_query_params() with some php scripts, but ran into this issue where I get: PHP message: PHP Warning: pg_query_params(): Query failed: ERROR: invalid input syntax for