Re: [GENERAL] pgbench
A 2013-10-03 17:50, Alvaro Herrera escrigué: Giuseppe Broccolo wrote: The format of the script file has to be one SQL command per line; multiline SQL commands are not supported, and empty lines are ignored. This could bring to errors. Could this be your case? Multiline SQL commands are not supported? Well that sucks, because only BUFSIZ chars are read from each line. In my platform that's 8192, but maybe in Simeó's case it's shorter .. or maybe his query really is longer than 8192 bytes. This smells like a pgbench bug to me. -- Álvaro Herrerahttp://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training Services Álvaro, you hit the nail on the head! I have seen that in stdio.h BUFSIZ is defined like 1024 in freeBSD 9.0, probably for this reason I can't test this query (1657 characters), but I'm able to test shorter queries. Finally I have done a plsql procedure to call the query from pgbench. Meanwhile I will try to figure out if I can increase this variable without affect the system. Thanks to all Simeó Reig Barcelona (Spain) -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
[GENERAL] pgbench
Hello I was doing a performance test with pgbench with a pretty long queries and I have the next error: $ pgbench -n -c1 -T 3 -f veins_pgbench.sql pdn Client 0 aborted in state 0: ERROR: syntax error at end of input LINE 1: ...(abc.persones.provincia = abc.poblacions.cod_provinc ^ transaction type: Custom query scaling factor: 1 query mode: simple number of clients: 1 number of threads: 1 duration: 3 s number of transactions actually processed: 0 tps = 0.00 (including connections establishing) tps = 0.00 (excluding connections establishing) I believe pgbench has a very low limit with the queries you can put inside a file with the 't' option. Am I right? How can avoid it ? My best regards Simeó Reig Barcelona (Spain) -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
Re: [GENERAL] pgbench
A 2013-10-03 15:51, Adrian Klaver escrigué: On 10/03/2013 06:21 AM, Simeó Reig wrote: Hello I was doing a performance test with pgbench with a pretty long queries and I have the next error: $ pgbench -n -c1 -T 3 -f veins_pgbench.sql pdn Client 0 aborted in state 0: ERROR: syntax error at end of input LINE 1: ...(abc.persones.provincia = abc.poblacions.cod_provinc ^ transaction type: Custom query scaling factor: 1 query mode: simple number of clients: 1 number of threads: 1 duration: 3 s number of transactions actually processed: 0 tps = 0.00 (including connections establishing) tps = 0.00 (excluding connections establishing) I believe pgbench has a very low limit with the queries you can put inside a file with the 't' option. Am I right? How can avoid it ? Well first you say 't' option but show 'T' option, they are different. Second the error is reporting a syntax error in your script, so I would look there first. Yes, I did I mistake. I would say 'f' option (file option) not 't' option, sorry . But no, there is no mistake with the script, I can do: # psql -d pdn veins_pgbench.sql and it works perfectly thanks Adrian, I'm almost sure that the problem is the query is too long for pgbench (1600 characters) Best regards Simeó Reig Barcelona (Spain) -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
Re: [GENERAL] pgbench
A 2013-10-03 16:16, Adrian Klaver escrigué: On 10/03/2013 07:11 AM, Simeó Reig wrote: A 2013-10-03 15:51, Adrian Klaver escrigué: On 10/03/2013 06:21 AM, Simeó Reig wrote: Hello I was doing a performance test with pgbench with a pretty long queries and I have the next error: $ pgbench -n -c1 -T 3 -f veins_pgbench.sql pdn Client 0 aborted in state 0: ERROR: syntax error at end of input LINE 1: ...(abc.persones.provincia = abc.poblacions.cod_provinc ^ transaction type: Custom query scaling factor: 1 query mode: simple number of clients: 1 number of threads: 1 duration: 3 s number of transactions actually processed: 0 tps = 0.00 (including connections establishing) tps = 0.00 (excluding connections establishing) I believe pgbench has a very low limit with the queries you can put inside a file with the 't' option. Am I right? How can avoid it ? Well first you say 't' option but show 'T' option, they are different. Second the error is reporting a syntax error in your script, so I would look there first. Yes, I did I mistake. I would say 'f' option (file option) not 't' option, sorry . But no, there is no mistake with the script, I can do: # psql -d pdn veins_pgbench.sql and it works perfectly thanks Adrian, I'm almost sure that the problem is the query is too long for pgbench (1600 characters) You have not shown the query, but could you be running into the belwo: http://www.postgresql.org/docs/9.3/interactive/pgbench.html The format of a script file is one SQL command per line; multiline SQL commands are not supported. Empty lines and lines beginning with -- are ignored. Script file lines can also be meta commands, which are interpreted by pgbench itself, as described below. I did it, and I read it all ... I'm use to work with postgresql and freeBSD world since too years ago ;-) Thanks again Adrian Simeó Reig Barcelona (Spain) -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
Re: [GENERAL] pgbench
A 2013-10-03 16:40, Adrian Klaver escrigué: On 10/03/2013 07:23 AM, Simeó Reig wrote: You have not shown the query, but could you be running into the belwo: http://www.postgresql.org/docs/9.3/interactive/pgbench.html The format of a script file is one SQL command per line; multiline SQL commands are not supported. Empty lines and lines beginning with -- are ignored. Script file lines can also be meta commands, which are interpreted by pgbench itself, as described below. I did it, and I read it all ... I'm use to work with postgresql and freeBSD world since too years ago ;-) Obviously pgbench has issues with the syntax in the file. Without the contents of the file I am just doing some educated guessing. To get to a solution you will need to show your custom file. Yes you are right, It has an issue with the syntax, because it only reads a portion of the query, and obviously it's not correct if you do it. Unfortunately I can't put the sql here, but I repeat: I could do: psql -d databasename scrip_file.sql and it works perfectly, and It is a one line query. I did it with many queries since today, but I think this is too long Many many thanks for your interest Adrian Simeó Reig Barcelona (Spain) -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
Re: [GENERAL] PHP with Postgres
El dia 04-Aug-99 en Kevin Heflin va escriure : Go to www.php.net in the online manual, it shows all the pg_ functions of php. If you are looking for an acutal book, I've recently bought a PHP programming books from amazon.com, I didn't find that it went into any more detail than the online documentation. But does have some explanation of basic programming for the beginner. The specific link for the postgres functions can be found at: http://www.php.net/manual/ref.pgsql.php3 Kevin Oh ,yes !! Thanks Kevin Simeó Reig [EMAIL PROTECTED] Barcelona (SPAIN) -
[GENERAL] Foreign Keys in PostgreSQL
How can I implement foreign Keys with postgres? thanks. Simeó Reig [EMAIL PROTECTED] Barcelona (SPAIN) -