Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id A46F49FC2AB for ; Fri, 24 Nov 2006 15:45:56 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 96462-01-6 for ; Fri, 24 Nov 2006 15:45:53 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.172]) by postgresql.org (Postfix) with ESMTP id 4296B9FC303 for ; Fri, 24 Nov 2006 15:12:29 -0400 (AST) Received: by ug-out-1314.google.com with SMTP id k3so658422ugf for ; Fri, 24 Nov 2006 11:12:27 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=agxR6yxAUyP/d5veKlEFN0ZTsPvGB/BotrKJ02MogOZ8ws7pm+weaVxU5odbSbTgoR3z0nsEGuNtcQ/TNonmkZol9CXITx3JJ2Pp8022JO2of9CPzl9cEjz0odiZBoEQhRX/vlbdtxdQ1kC+yiB5N344fJSKJcjpX/cmzy/9bUg= Received: by 10.66.216.20 with SMTP id o20mr7495900ugg.1164395547391; Fri, 24 Nov 2006 11:12:27 -0800 (PST) Received: by 10.66.223.9 with HTTP; Fri, 24 Nov 2006 11:12:27 -0800 (PST) Message-ID: Date: Fri, 24 Nov 2006 16:12:27 -0300 From: "Marcelo Costa" To: "Stephan Szabo" Subject: Re: Function ERRO after UPGRADE from 7.4 to 8.1.5 Cc: pgsql-admin@postgresql.org In-Reply-To: <20061124110401.H11828@megazone.bigpanda.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20061124110401.H11828@megazone.bigpanda.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/211 X-Sequence-Number: 23738 Thanks, its works. [],s Marcelo. 2006/11/24, Stephan Szabo : > On Fri, 24 Nov 2006, Marcelo Costa wrote: > > > Hi, all > > > > I migrate my database from 7.4 to 8.1.5 and make tests with aplication > > but this don=B4t works fine. > > > > Some trigers don=B4t work and send to me error messages as this: > > > > Warning: pg_query(): Query failed: ERROR: INSERT is not allowed in a > > non-volatile > > function CONTEXT: SQL statement "insert into > > ave.ave_aluno_avaliacao_diario_historico ( > > codigo_ave_avaliacao , codigo_ave_aluno_caderneta , nota , presenca , f= alta , > > data_cadastro , justificativa , codigo_usuario ) select codigo_ave_aval= iacao , > > codigo_ave_aluno_caderneta , nota , presenca , falta , data_cadastro , > > justificativa , > > codigo_usuario from ave.ave_aluno_avaliacao_diario where > > codigo_ave_aluno_caderneta =3D $1 and codigo_ave_avaliacao =3D $2 " > > PL/pgSQL function > > "func_trg_ave_aluno_avaliacao_diario_a_iu" line 16 at SQL statement in.= ..(...) > > > > I see all trigers including func_trg_ave_aluno_avaliacao_diario_a_iu > > and compile this but no erros send to me. > > > > Anybory can help me or send to me any link to that it can clarify. > > This looks to be from the following change in the 8.0 release notes: > > "Functions declared STABLE or IMMUTABLE always use the snapshot of the > calling query, and therefore do not see the effects of actions taken afte= r > the calling query starts, whether in their own transaction or other > transactions. Such a function must be read-only, too, meaning that it > cannot use any SQL commands other than SELECT." > > You probably will need to redefine the functions to be volatile if > they're currently stable or immutable. > --=20 Marcelo Costa