pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Function ERRO after UPGRADE from 7.4 to 8.1.5
4+ messages / 3 participants
[nested] [flat]

* Function ERRO after UPGRADE from 7.4 to 8.1.5
@ 2006-11-24 17:45  Marcelo Costa <marcelojscosta@gmail.com>
  0 siblings, 2 replies; 4+ messages in thread

From: Marcelo Costa @ 2006-11-24 17:45 UTC (permalink / raw)
  To: pgsql-admin

Hi, all

I migrate my database from 7.4 to 8.1.5 and make tests with aplication
but this don´t works fine.

Some trigers don´t 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 , falta ,
data_cadastro , justificativa , codigo_usuario ) select codigo_ave_avaliacao ,
codigo_ave_aluno_caderneta , nota , presenca , falta , data_cadastro ,
justificativa ,
codigo_usuario from ave.ave_aluno_avaliacao_diario where
codigo_ave_aluno_caderneta = $1 and codigo_ave_avaliacao = $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.

Thanks,

Marcelo Costa
Secretaria Executiva de Educação do Pará
Amazônia - Pará - Brazil


-- 
Marcelo Costa



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Function ERRO after UPGRADE from 7.4 to 8.1.5
@ 2006-11-24 19:05  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Marcelo Costa <marcelojscosta@gmail.com>
  1 sibling, 0 replies; 4+ messages in thread

From: Tom Lane @ 2006-11-24 19:05 UTC (permalink / raw)
  To: Marcelo Costa <marcelojscosta@gmail.com>; +Cc: pgsql-admin

"Marcelo Costa" <marcelojscosta@gmail.com> writes:
> I migrate my database from 7.4 to 8.1.5 and make tests with aplication
> but this don´t works fine.

> Some trigers don´t work and send to me error messages as this:

> Warning: pg_query(): Query failed: ERROR: INSERT is not allowed in a
> non-volatile function

What do you find unclear about the error message?

It was never a sane idea to try to modify the database in a function
marked immutable or stable, because of the risk that the side-effects
would get optimized away.  8.1 enforces that, where older versions did
not.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Function ERRO after UPGRADE from 7.4 to 8.1.5
@ 2006-11-24 19:05  Stephan Szabo <sszabo@megazone.bigpanda.com>
  parent: Marcelo Costa <marcelojscosta@gmail.com>
  1 sibling, 1 reply; 4+ messages in thread

From: Stephan Szabo @ 2006-11-24 19:05 UTC (permalink / raw)
  To: Marcelo Costa <marcelojscosta@gmail.com>; +Cc: pgsql-admin

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´t works fine.
>
> Some trigers don´t 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 , falta ,
> data_cadastro , justificativa , codigo_usuario ) select codigo_ave_avaliacao ,
> codigo_ave_aluno_caderneta , nota , presenca , falta , data_cadastro ,
> justificativa ,
> codigo_usuario from ave.ave_aluno_avaliacao_diario where
> codigo_ave_aluno_caderneta = $1 and codigo_ave_avaliacao = $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 after
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.



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Function ERRO after UPGRADE from 7.4 to 8.1.5
@ 2006-11-24 19:12  Marcelo Costa <marcelojscosta@gmail.com>
  parent: Stephan Szabo <sszabo@megazone.bigpanda.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Marcelo Costa @ 2006-11-24 19:12 UTC (permalink / raw)
  To: Stephan Szabo <sszabo@megazone.bigpanda.com>; +Cc: pgsql-admin

Thanks, its works.

[],s

Marcelo.

2006/11/24, Stephan Szabo <sszabo@megazone.bigpanda.com>:
> 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´t works fine.
> >
> > Some trigers don´t 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 , falta ,
> > data_cadastro , justificativa , codigo_usuario ) select codigo_ave_avaliacao ,
> > codigo_ave_aluno_caderneta , nota , presenca , falta , data_cadastro ,
> > justificativa ,
> > codigo_usuario from ave.ave_aluno_avaliacao_diario where
> > codigo_ave_aluno_caderneta = $1 and codigo_ave_avaliacao = $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 after
> 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.
>


-- 
Marcelo Costa



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2006-11-24 19:12 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-11-24 17:45 Function ERRO after UPGRADE from 7.4 to 8.1.5 Marcelo Costa <marcelojscosta@gmail.com>
2006-11-24 19:05 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-11-24 19:05 ` Stephan Szabo <sszabo@megazone.bigpanda.com>
2006-11-24 19:12   ` Marcelo Costa <marcelojscosta@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox