470,580 Members | 2,205 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,580 developers. It's quick & easy.

Temporary table

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
1 1622
"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.

Similar topics

reply views Thread by Didier ROS | last post: by
reply views Thread by nedbollard | last post: by
5 posts views Thread by Adam W. Saxton | last post: by
1 post views Thread by livre | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.