By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,779 Members | 1,241 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,779 IT Pros & Developers. It's quick & easy.

Temporary table

P: n/a
There is a query:
$sqlcmd = "CREATE TEMP TABLE tmp_table1 AS SELECT " .$p_distinct. " "
..$sql_columns. " FROM " .$sql_table ;
Next I have command:
$sqlcmd_tmp = $sqlcmd;
$tmp_res = pg_Exec( $conn, $sqlcmd_tmp );
Always it's ok, so it's execute without any problems. But sometimes I get
error like this :
Warning: pg_exec()[function.pg-exec]:Query failed:ERROR: cache lookup of
relation 149064743 failed.

A little bit further I have code like this :
$sqlcmd_count = "SELECT * FROM tmp_table1";
$tmp_count = pg_Exec( $conn, $sqlcmd_count );
So it's also working well, but as in previous example sometimes I'm getting
error like that:
Warning: pg_exec()[function.pg-exec]:Query failed: ERROR: Relation
"tmp_table1" does not exist.

So I'd like to know why it is so. Are there any config parameters, which are
responsible for creating temporaty tables and so on. And the other thing is
can't it be depend on max amount of clients server can support (or maybe
shared memory and so on).
Anyway thanks for answers.

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 11 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
"Juris Krumins" <ju*****@komin.lv> writes:
Always it's ok, so it's execute without any problems. But sometimes I get
error like this :
Warning: pg_exec()[function.pg-exec]:Query failed:ERROR: cache lookup of
relation 149064743 failed.


Hmm, that seems bad. Is the given relation number always the same? Is
there a row with that OID in pg_class? (Try "select * from pg_class
where oid = 149064743".)

What PG version is this?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 11 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.