Re: Rules and variables?

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Christian Rishoej <chrris(at)mail(dot)dk>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Rules and variables?
Date: 2002-05-17 23:53:33
Message-ID: 200205171653.33416.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


Christian,

> I need to hold an integer value and use it in some queries in a rule I
> have. I tried to use a temporary table, but without luck (got an error
> like Relation "tmpfoo" does not exist ).
>
> My question is: How can I hold this value thoughout the rule? Can I use
> variables of some sort?

Have the rule execute a PL/pgSQL function. PL/pgSQL has full variable
support; see the documentation under "procedural functions".

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2002-05-18 00:19:38 PL/pgSQL TODO
Previous Message Christian Rishoej 2002-05-17 23:39:04 Rules and variables?