Re: [SQL] For loop

2007-03-13 Thread Ezequias R. da Rocha
Ezequias R. da Rocha escreveu: Hi list, I would like to test the power of processing of postgresql (and my server) by insert a large ammount of data on a table I have. I would like to know how to implement a For... loop . With it I think I could check the real power of my server. Ezequias

Re: [SQL] For loop

2007-03-13 Thread Bart Degryse
As you can see in the manual (http://www.postgresql.org/docs/8.1/interactive/plpgsql-control-structures.html) you have to remove the ; after the initial LOOP LOOP statements IF i 100 THEN EXIT; END LOOP; Or you can try... WHILE i = 100 LOOP statements END LOOP; Or

Re: [SQL] For loop

2007-03-13 Thread Ezequias R. da Rocha
They are not working well. Allways the same error. (if while) ERROR: syntax error at or near WHILE SQL state: 42601 Character: 1 (if for) ERROR: syntax error at or near FOR SQL state: 42601 Character: 1 (if loop) ERROR: syntax error at or near LOOP SQL state: 42601 Character: 1 I installed

Re: [SQL] For loop

2007-03-13 Thread Bart Degryse
Please post your complete CREATE FUNCTION statement. Error code 42601 refers to some syntax error which probably occurs just before you start looping. To find it I need to see more code. Please don't mail me directly. Only mail to pgsql-sql@postgresql.org Ezequias R. da Rocha [EMAIL

Re: [SQL] For loop

2007-03-13 Thread Alvaro Herrera
Ezequias R. da Rocha wrote: They are not working well. Allways the same error. (if while) ERROR: syntax error at or near WHILE SQL state: 42601 Character: 1 You may have a problem in the code just _before_ these lines. -- Alvaro Herrera

Re: [SQL] For loop

2007-03-13 Thread Adrian Klaver
On Tuesday 13 March 2007 6:19 am, Ezequias R. da Rocha wrote: They are not working well. Allways the same error. (if while) ERROR: syntax error at or near WHILE SQL state: 42601 Character: 1 (if for) ERROR: syntax error at or near FOR SQL state: 42601 Character: 1 (if loop) ERROR:

Re: [SQL] For loop

2007-03-13 Thread Ezequias R. da Rocha
I quetion one more time. I must have a function ? Isn't another way to implement it without using functions ? Ezequias Bart Degryse escreveu: Please post your complete CREATE FUNCTION statement. Error code 42601 refers to some syntax error which probably occurs just before you start looping.

Re: [SQL] For loop

2007-03-13 Thread Jonah H. Harris
On 3/13/07, Ezequias R. da Rocha [EMAIL PROTECTED] wrote: I quetion one more time. I must have a function ? Isn't another way to implement it without using functions ? Not in PostgreSQL. Here's a sample of something similar to what you were doing. CREATE LANGUAGE plpgsql; CREATE TABLE carga

Re: [SQL] For loop

2007-03-13 Thread Bart Degryse
AFAK you can also use them in eg CREATE TRIGGER and on the psql command prompt. What are you trying to accomplish. When we understand that, maybe we can point you in the right direction. Ezequias R. da Rocha [EMAIL PROTECTED] 2007-03-13 14:30 I quetion one more time. I must have a function ?

Re: [SQL] For loop

2007-03-13 Thread A. Kretschmer
am Tue, dem 13.03.2007, um 10:30:59 -0300 mailte Ezequias R. da Rocha folgendes: I quetion one more time. I must have a function ? Isn't another way to implement it without using functions ? Yes, you need a function. SQL doesn't know LOOPs. And, please, no silly fullquote. [100 lines

[SQL] For loop

2007-03-13 Thread Ezequias R. da Rocha
Hi list, I would like to test the power of processing of postgresql (and my server) by insert a large ammount of data on a table I have. I would like to know how to implement a For... loop . With it I think I could check the real power of my server. Ezequias

Re: [SQL] For loop

2007-03-13 Thread Alvaro Herrera
Ezequias R. da Rocha wrote: Thank you all. The function from Jonah solves my problem. Just a simple question: One million of inserctions in *28,8* seconds with this kind of data (timestamp|character varring (50)) is a good performance ? I let my questions to DBAs from PostgreSQL. I

Re: [SQL] For loop

2007-03-13 Thread Ezequias R. da Rocha
I rewritte the Jonah's function to: FOR iter IN 1 .. num_iter LOOP -- some computations INSERT INTO carga (descricao) VALUES ('CardPass'); END LOOP; My ID is now() by default And it was in 23sec After I changed the insert to: INSERT INTO carga (id,descricao) VALUES

[SQL] PgAdmin 1.6.2 crashes when resize the collumn

2007-03-13 Thread Ezequias Rodrigues da Rocha
Hi list, I had no problem with pgadmin 1.6.2 until I instal PostgreSQL 8.2.3 Now when I resize the column in any place the pgadmin crashes. Another problem is that when I move the mouse over the table in the sql dialog the columns are selected. I don't know if it is a problem of the mouse but

Re: [SQL] PgAdmin 1.6.2 crashes when resize the collumn

2007-03-13 Thread Richard Huxton
Ezequias Rodrigues da Rocha wrote: Hi list, I had no problem with pgadmin 1.6.2 until I instal PostgreSQL 8.2.3 Now when I resize the column in any place the pgadmin crashes. Another problem is that when I move the mouse over the table in the sql dialog the columns are selected. I don't know

[SQL] PgAgent logging verbosity

2007-03-13 Thread Ezequias Rodrigues da Rocha
Hi list, I would like to know if I set the debug mode to 2 (-l 2) in the pgAgent connection string it could spend much cpu processing. I have other things running in the server and I don't like to create problem to others. -- Ezequias Rodrigues da Rocha http://ezequiasrocha.blogspot.com/ use

Re: [SQL] [GENERAL] PgAgent logging verbosity

2007-03-13 Thread Dave Page
Ezequias Rodrigues da Rocha wrote: Hi list, I would like to know if I set the debug mode to 2 (-l 2) in the pgAgent connection string it could spend much cpu processing. I have other things running in the server and I don't like to create problem to others. Please stop cross posting to

Re: [SQL] [ADMIN] [GENERAL] PgAgent logging verbosity

2007-03-13 Thread Ezequias R. da Rocha
Ok I will use only on error ok ? -l 0 :) Thank you Dave Page escreveu: Ezequias Rodrigues da Rocha wrote: Hi list, I would like to know if I set the debug mode to 2 (-l 2) in the pgAgent connection string it could spend much cpu processing. I have other things running in the server and

Re: [SQL] [ADMIN] [GENERAL] PgAgent logging verbosity

2007-03-13 Thread Dave Page
Ezequias R. da Rocha wrote: Ok I will use only on error ok ? -l 0 :) In the normal case, yes, that is what I'd use (0 is the default in fact, so you can omit the option altogether). Regard,s Dave ---(end of broadcast)--- TIP 2: Don't 'kill

[SQL] postgres configuration

2007-03-13 Thread Sumeet
Hi All, Sorry if this is the wrong list to ask this question. My Vacuum's are running very very slow and expecially when vacuuming indexes in large tables of size in 5-10 gigabytes, can some one help me determine the parameters for postgres.conf which will help me vacuum fast. I'm running

Re: [SQL] postgres configuration

2007-03-13 Thread Andrej Ricnik-Bay
On 3/14/07, Sumeet [EMAIL PROTECTED] wrote: Hi All, Hi, Sorry if this is the wrong list to ask this question. General woould have been better :) My Vacuum's are running very very slow and expecially when vacuuming indexes in large tables of size in 5-10 gigabytes, can some one help me

[SQL] Maintence DB

2007-03-13 Thread Ezequias R. da Rocha
Hi list, Could someone tell me in a simple way what does Maintence DB means ? Regards Ezequias ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so

Re: [SQL] Maintence DB

2007-03-13 Thread Greg Toombs
(From the pgadmin documentation) "The maintenance DB field is used to specify the initial database that pgAdmin connects to, and that will be expected to have the pgAgent schema and adminpack objects installed (both optional). On PostgreSQL 8.1 and above, the maintenance DB is normally called

Re: [SQL] postgres configuration

2007-03-13 Thread Sumeet
The only info i have is Apple xRaid drive array with 14 400GB drives for a total of 5 TB storage I have around 10-15 indexes for each tables. does the number of indexes slow down the vacuum process? indexes are compund indexes on multiple fields. -Sumeet On 3/13/07, Andrej Ricnik-Bay [EMAIL

Re: [SQL] postgres configuration

2007-03-13 Thread Scott Marlowe
On Tue, 2007-03-13 at 15:48, Sumeet wrote: On 3/13/07, Andrej Ricnik-Bay [EMAIL PROTECTED] wrote: On 3/14/07, Sumeet [EMAIL PROTECTED] wrote: Hi All, Hi, Sorry if this is the wrong list to ask this question. General woould have been better

Re: [SQL] postgres configuration

2007-03-13 Thread Tom Lane
Sumeet [EMAIL PROTECTED] writes: My Vacuum's are running very very slow and expecially when vacuuming indexes in large tables of size in 5-10 gigabytes, can some one help me determine the parameters for postgres.conf which will help me vacuum fast. I'm running postgres on a server with 32 gigs

[SQL] import CSV file

2007-03-13 Thread T E Schmitz
I am trying to batch-load a tab-separated CSV file: psql -h lolek -U tes -d stockmarket -c copy history from '/tmp/FTSE.csv' CSV; ERROR: could not open file /tmp/FTSE.csv for reading: No such file or directory The file exists. Do I need to escape the quotes? set-up: Postgres 8.1,

Re: [SQL] import CSV file

2007-03-13 Thread Alvaro Herrera
T E Schmitz wrote: I am trying to batch-load a tab-separated CSV file: psql -h lolek -U tes -d stockmarket -c copy history from '/tmp/FTSE.csv' CSV; ERROR: could not open file /tmp/FTSE.csv for reading: No such file or directory The file exists. Do I need to escape the quotes? Is

Re: [SQL] import CSV file

2007-03-13 Thread D'Arcy J.M. Cain
On Tue, 13 Mar 2007 20:38:33 + T E Schmitz [EMAIL PROTECTED] wrote: I am trying to batch-load a tab-separated CSV file: psql -h lolek -U tes -d stockmarket -c copy history from '/tmp/FTSE.csv' CSV; ERROR: could not open file /tmp/FTSE.csv for reading: No such file or directory

Re: [SQL] import CSV file

2007-03-13 Thread Jure Kodzoman
On Tue, 2007-03-13 at 20:38 +, T E Schmitz wrote: I am trying to batch-load a tab-separated CSV file: psql -h lolek -U tes -d stockmarket -c copy history from '/tmp/FTSE.csv' CSV; ERROR: could not open file /tmp/FTSE.csv for reading: No such file or directory The file exists.

Re: [SQL] import CSV file

2007-03-13 Thread T E Schmitz
D'Arcy J.M. Cain wrote: On Tue, 13 Mar 2007 20:38:33 + T E Schmitz [EMAIL PROTECTED] wrote: I am trying to batch-load a tab-separated CSV file: psql -h lolek -U tes -d stockmarket -c copy history from '/tmp/FTSE.csv' CSV; ERROR: could not open file /tmp/FTSE.csv for reading: No such

Re: [SQL] import CSV file

2007-03-13 Thread T E Schmitz
Jure Kodzoman wrote: On Tue, 2007-03-13 at 20:38 +, T E Schmitz wrote: I am trying to batch-load a tab-separated CSV file: psql -h lolek -U tes -d stockmarket -c copy history from '/tmp/FTSE.csv' CSV; ERROR: could not open file /tmp/FTSE.csv for reading: No such file or directory

Re: [SQL] import CSV file

2007-03-13 Thread T E Schmitz
D'Arcy J.M. Cain wrote: On Tue, 13 Mar 2007 20:38:33 + T E Schmitz [EMAIL PROTECTED] wrote: psql -h lolek -U tes -d stockmarket -c copy history from STDIN CSV /tmp/FTSE.csv Also, it's nopt happy about the date format : 2007/02/09 -- Regards, Tarlika Elisabeth Schmitz

Re: [SQL] Maintence DB

2007-03-13 Thread Jonah H. Harris
On 3/13/07, Ezequias R. da Rocha [EMAIL PROTECTED] wrote: Could someone tell me in a simple way what does Maintence DB means ? Ezequias, Not trying to be a PITA here, because I'm more than happy to help. But it seems like you ask a lot of questions that could easily be answered if you read

Re: [SQL] import CSV file

2007-03-13 Thread Rodrigo De León
On 3/13/07, T E Schmitz [EMAIL PROTECTED] wrote: This is pretty ingenious! Just a few minor problems: - how does COPY know which column is which? - how do I specify DELIMITER as TAB? See: http://www.postgresql.org/docs/8.2/static/sql-copy.html Also, it's nopt happy about the date format :