Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 288ED9FB6D4 for ; Tue, 13 Mar 2007 11:06:18 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 93255-03 for ; Tue, 13 Mar 2007 11:06:04 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from correio2.docasdoporto.com.br (8.144.199.200.docasdoporto.com.br [200.199.144.8]) by postgresql.org (Postfix) with ESMTP id 4E2C79FB399 for ; Tue, 13 Mar 2007 11:06:09 -0300 (ADT) Received: from [201.30.172.2] (account ezequias@fastcon.com.br HELO [192.168.0.110]) by correio2.docasdoporto.com.br (CommuniGate Pro SMTP 4.1.8) with ESMTP id 46360306 for pgsql-sql@postgresql.org; Tue, 13 Mar 2007 11:23:09 -0300 Message-ID: <45F6AF3B.4080706@fastcon.com.br> Date: Tue, 13 Mar 2007 11:03:39 -0300 From: "Ezequias R. da Rocha" User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: For loop References: <45F69D7C.4070304@fastcon.com.br> <45F6B4EB.A3DD.0030.0@indicator.be> <45F6A793.1090904@fastcon.com.br> <200703130644.20870.aklaver@comcast.net> In-Reply-To: <200703130644.20870.aklaver@comcast.net> Content-Type: multipart/alternative; boundary="------------020402030302060202000108" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200703/166 X-Sequence-Number: 27804 This is a multi-part message in MIME format. --------------020402030302060202000108 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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. Sincerely Ezequias Adrian Klaver escreveu: > On Tuesday 13 March 2007 6:30 am, Ezequias R. da Rocha wrote: > >> 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. 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" 2007-03-13 14:19 >>> >>>>>> >>> 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 the pgsql but I don't think it is a problem of language. >>> What could be wrong ? I am not using functions too. I am using the SQL >>> tool of PgAdmin III. >>> >>> Any help would be glad. >>> >>> Ezequias >>> >>> > If you want to use plpgsql it needs to be within a function. > --------------020402030302060202000108 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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.

Sincerely
Ezequias
Adrian Klaver escreveu:
On Tuesday 13 March 2007 6:30 am, Ezequias R. da Rocha wrote:
  
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. To find it I need to see more code.
Please don't mail me directly. Only mail to pgsql-sql@postgresql.org
<mailto:pgsql-sql@postgresql.org>

      
"Ezequias R. da Rocha" <ezequias@fastcon.com.br> 2007-03-13 14:19 >>>
            
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 the pgsql but I don't think it is a problem of language.
What could be wrong ? I am not using functions too. I am using the SQL
tool of PgAdmin III.

Any help would be glad.

Ezequias

      
If you want to use plpgsql it needs to be within a function.
  

--------------020402030302060202000108--