Thank you all. The function from Jonah solves my problem.<br /><br /> Just a simple question:<br /><br /> One million
ofinserctions in <b>28,8</b> seconds with this kind of data (timestamp|character varring (50)) is a good performance
?<br/><br /> I let my questions to DBAs from PostgreSQL.<br /><br /> Sincerely<br /> Ezequias<br /> Adrian Klaver
escreveu:<blockquote cite="mid200703130644.20870.aklaver@comcast.net" type="cite"><pre wrap="">On Tuesday 13 March 2007
6:30am, Ezequias R. da Rocha wrote: </pre><blockquote type="cite"><pre wrap="">I quetion one more time. I must have a
function? Isn't another way to
implement it without using functions ?
Ezequias
Bart Degryse escreveu: </pre><blockquote type="cite"><pre wrap="">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 <a class="moz-txt-link-abbreviated"
href="mailto:pgsql-sql@postgresql.org">pgsql-sql@postgresql.org</a>
<a class="moz-txt-link-rfc2396E" href="mailto:pgsql-sql@postgresql.org"><mailto:pgsql-sql@postgresql.org></a>
</pre><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><pre wrap="">"Ezequias R. da Rocha"
<aclass="moz-txt-link-rfc2396E" href="mailto:ezequias@fastcon.com.br"><ezequias@fastcon.com.br></a> 2007-03-13
14:19>>> </pre></blockquote></blockquote></blockquote><pre wrap="">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
</pre></blockquote></blockquote><pre wrap="">If you want to use plpgsql it needs to be within a function.
</pre></blockquote><br/>