pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: FET <bilaribilari@yahoo.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Stored procedures and relations
Date: Fri, 28 Nov 2003 19:09:47 -0800 (PST)
Message-ID: <20031128190810.J52057@megazone.bigpanda.com> (raw)
In-Reply-To: <f86b739.0311280120.15475f08@posting.google.com>
References: <f86b739.0311280120.15475f08@posting.google.com>


On Fri, 28 Nov 2003, FET wrote:

> Hi everybody,
> I have a stored procedure that drops table A and then creates table A
> again. The table A has no constraints on any columns. When I execute
> the stored procedure by saying: SELECT sp_myproc(); It gives me an
> error saying : Relation 68428 does not exist.
>
> When I remove the CREATE FUNCTION and the stuff used to make it a
> stored procedure, and run the commands in the procedure, it works
> correctly.
>
> This behaviour is observed on all stored procedures on PG-SQL. I would
> really appreciate any help or interpretation of this error. By the
> way, the same stored procedure (with the syntax changed of course)
> works perfectly on MS SQL Server.

You haven't given too many details about what your function does, but, in
general if you're accessing a table whose structure is being dynamically
modified during/between calls, you'll currently want to be using EXECUTE
on queries relating to that table.




view thread (2+ messages)

Message-ID: <20031128190810.J52057@megazone.bigpanda.com>
Permalink:  ../20031128190810.J52057@megazone.bigpanda.com/
Also on:    postgresql.org/message-id/20031128190810.J52057@megazone.bigpanda.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sszabo@megazone.bigpanda.com, bilaribilari@yahoo.com
  Subject: Re: Stored procedures and relations
  In-Reply-To: <20031128190810.J52057@megazone.bigpanda.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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