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 wrote: > patrick keshishian 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

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

2014-05-16 Thread Tom Lane
patrick keshishian 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', now()), dat

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

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 adrian.kla...@akl

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 mess

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: conn=psycopg2.connect(db

Re: [GENERAL] Monitoring Streaming Replication in 9.2

2014-05-16 Thread dinesh kumar
Hi, Hereis 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 manojadinesh

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 confi

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

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

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

Re: [GENERAL] pgsql in a virtual environment

2014-05-16 Thread Tom Lane
=?UTF-8?B?TWFydMOtbiBNYXJxdcOpcw==?= writes: > 2014-05-16 11:56 GMT-03:00 Graeme Gemmill : >> $ ./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 > Looks like a libpq - backend

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 Martín Marqués
2014-05-16 11:56 GMT-03:00 Graeme Gemmill : > $ ./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 > Is there

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:

[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] 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 happ

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 subscri

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 > > > SS_dos.JPG > You'll ha

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 wrote: > 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 i

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 SS_dos.JPG

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

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 > You need to learn to write proper Python code, especially try: except

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 P

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 SS_dos.JPG In advance, thank you. Regards. IMAGE.

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 wrote: > Dear all, > > I'm writing a python script for a w

[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] 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(); pg_xlo