pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Rules and variables?
2+ messages / 2 participants
[nested] [flat]

* Rules and variables?
@ 2002-05-17 23:39 Christian Rishoej <chrris@mail.dk>
  2002-05-17 23:53 ` Re: Rules and variables? Josh Berkus <josh@agliodbs.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Christian Rishoej @ 2002-05-17 23:39 UTC (permalink / raw)
  To: pgsql-sql


Hi,

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?

Christian






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

* Re: Rules and variables?
  2002-05-17 23:39 Rules and variables? Christian Rishoej <chrris@mail.dk>
@ 2002-05-17 23:53 ` Josh Berkus <josh@agliodbs.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Josh Berkus @ 2002-05-17 23:53 UTC (permalink / raw)
  To: Christian Rishoej <chrris@mail.dk>; 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".




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


end of thread, other threads:[~2002-05-17 23:53 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-05-17 23:39 Rules and variables? Christian Rishoej <chrris@mail.dk>
2002-05-17 23:53 ` Josh Berkus <josh@agliodbs.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