473,698 Members | 2,426 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error: relation with OID 22938 does not exist

10 New Member
I am having some problems understanding how the temp tables work in PG. I have a relatively lengthy function I am creating that makes frequent use of temporary tables.

I am dropping and recreating the temp tables on each run. If I run the procedure the first time via psql it seems to run fine. If I try to immediately run it again I get the following message:

Error: relation with OID 22938 does not exist

The query it is running is the following:

Select Into sTableName TableName From tmp_tblJoin Where ID = 1;

Nothing special about it other than "tmp_tblJoi n" is defined as a temporary table.

I do understand what is happening (I think). There is a stale pointer to the previous instance of the temp table (that no longer exists) which is causing the function to blow up. My question is how to I stop it from storing the OID of the old reference.

plz help me out.........
Dec 6 '07 #1
3 10368
rski
700 Recognized Expert Contributor
I am having some problems understanding how the temp tables work in PG. I have a relatively lengthy function I am creating that makes frequent use of temporary tables.

I am dropping and recreating the temp tables on each run. If I run the procedure the first time via psql it seems to run fine. If I try to immediately run it again I get the following message:

Error: relation with OID 22938 does not exist

The query it is running is the following:

Select Into sTableName TableName From tmp_tblJoin Where ID = 1;

Nothing special about it other than "tmp_tblJoi n" is defined as a temporary table.

I do understand what is happening (I think). There is a stale pointer to the previous instance of the temp table (that no longer exists) which is causing the function to blow up. My question is how to I stop it from storing the OID of the old reference.

plz help me out.........
Maybe try to define a variable a set it to temporary table name. Then execute a dynamic query using your variable as table name. Understand?
Dec 6 '07 #2
Shree111
10 New Member
Maybe try to define a variable a set it to temporary table name. Then execute a dynamic query using your variable as table name. Understand?
i have done according to ur suggestion....b ut identifier is going to be truncated.

declare

stmt text:="(i have written query here)";

begin

execute stmt;

end;

it is going to be splitting that declared query.......

whats the solution for this????
Dec 6 '07 #3
rski
700 Recognized Expert Contributor
i have done according to ur suggestion....b ut identifier is going to be truncated.

declare

stmt text:="(i have written query here)";

begin

execute stmt;

end;

it is going to be splitting that declared query.......

whats the solution for this????

declare
table text
begin
table:='your_te mp_table';
execute 'select ......from '|| table;

is that works?
Dec 6 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
7201
by: S.Peppe | last post by:
Hi there! I'm really new at this game, so please forgive me if my request is at all irritating. I have installed PostgreSQL onto a Debian/Linux machine, and I have just upgraded PostgreSQL via the apt-get update & upgrade commands. However, whenever I get into the PostgreSQL interactive terminal thus sp@vanthoff:~$ psql -U postgres SHG
3
11376
by: Terrence Brannon | last post by:
I don't know what Postgres considers a relation and had no intention of creating one when piping my schema to it... I always DROP TABLE before CREATE TABLE, so here are the ERRORS emitted when building the database: 3:ERROR: table "country" does not exist 6:ERROR: table "customer" does not exist 11:ERROR: table "product" does not exist 15:ERROR: table "license" does not exist 19:ERROR: table "enduser" does not exist 24:ERROR: ...
0
2660
by: Dirk Frsterling | last post by:
Hi all, a few days ago, I upgraded from PostgreSQL 7.2.1 to 7.4, following the instructions in the INSTALL file, including dump and restore. All this worked fine without any error (message). Since then, I found lots of the following in the postmaster output: 2003-11-29 15:19:54 ERROR: large object 4838779 does not exist 2003-11-29 15:20:11 ERROR: large object 4838779 does not exist
6
4748
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much appreciated. Thanks in advance
15
2720
by: Hi5 | last post by:
Hi, I am designing a database for a client in which It has a client table including the followings: 1-Table Client 2-Table lookupcategory 3-Table Ctegory
669
25951
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic paper written on this subject. On the Expressive Power of Programming Languages, by Matthias Felleisen, 1990. http://www.ccs.neu.edu/home/cobbe/pl-seminar-jr/notes/2003-sep-26/expressive-slides.pdf
6
14383
by: crs27 | last post by:
Hai, Im getting this error.There is a column by name "nr_first_name" in the table "gistl_new_request". Yet im getting as that dose not exist.Would like to now what is the cause of it. Thank You
2
3117
by: hlnet | last post by:
I am newbie. I want use query : SELECT public.Master.ID, public.Master.Description from Master , but ->Error missing table Master .If use query : SELECT "public"."Master"."ID", "public"."Master"."Description" from "Master" It is OK. SELECT "ID", "Description" from "Master". It's OK SELECT ID, Description from "Master" . ERROR : column "id" does not exist at character 8.
1
8658
by: JaganMohanRao | last post by:
i have create a table and inserted a values init. when i am getting the values it is throwing the exception "ERROR: column "dtype" of relation "xxxx" does not exist" where xxxx is table name. if any body knows the solution kindly help me Thanks in advance .. Jagan
0
8678
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7737
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6525
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4371
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4621
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2333
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.