Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 6bec963

Browse files
committed
Re-add FAQ item:
<H3 id="item4.19">4.19) Why do I get "relation with OID ##### does not exist" errors when accessing temporary tables in PL/PgSQL functions?</H3>
1 parent 26cbf79 commit 6bec963

File tree

2 files changed

+43
-10
lines changed

2 files changed

+43
-10
lines changed

doc/FAQ

+20-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Frequently Asked Questions (FAQ) for PostgreSQL
33

4-
Last updated: Fri Oct 12 23:36:59 EDT 2007
4+
Last updated: Wed Oct 17 13:34:42 EDT 2007
55

66
Current maintainer: Bruce Momjian (bruce@momjian.us)
77

@@ -78,8 +78,10 @@
7878
4.16) How do I perform an outer join?
7979
4.17) How do I perform queries using multiple databases?
8080
4.18) How do I return multiple rows or columns from a function?
81-
4.19) What replication solutions are available?
82-
4.20) Why are my table and column names not recognized in my query?
81+
4.19) Why do I get "relation with OID ##### does not exist" errors
82+
when accessing temporary tables in PL/PgSQL functions?
83+
4.20) What replication solutions are available?
84+
4.21) Why are my table and column names not recognized in my query?
8385
Why is capitalization not preserved?
8486
_________________________________________________________________
8587

@@ -790,7 +792,20 @@
790792
It is easy using set-returning functions,
791793
http://www.postgresql.org/docs/techdocs.17.
792794

793-
4.19) What replication solutions are available?
795+
4.19) Why do I get "relation with OID ##### does not exist" errors when
796+
accessing temporary tables in PL/PgSQL functions?
797+
798+
In PostgreSQL versions < 8.3, PL/PgSQL caches function scripts, and an
799+
unfortunate side effect is that if a PL/PgSQL function accesses a
800+
temporary table, and that table is later dropped and recreated, and
801+
the function called again, the function will fail because the cached
802+
function contents still point to the old temporary table. The solution
803+
is to use EXECUTE for temporary table access in PL/PgSQL. This will
804+
cause the query to be reparsed every time.
805+
806+
This problem does not occur in PostgreSQL 8.3 and later.
807+
808+
4.20) What replication solutions are available?
794809

795810
Though "replication" is a single term, there are several technologies
796811
for doing replication, with advantages and disadvantages for each.
@@ -809,7 +824,7 @@
809824
There are also commercial and hardware-based replication solutions
810825
available supporting a variety of replication models.
811826

812-
4.20) Why are my table and column names not recognized in my query? Why is
827+
4.21) Why are my table and column names not recognized in my query? Why is
813828
capitalization not preserved?
814829

815830
The most common cause of unrecognized names is the use of

doc/src/FAQ/FAQ.html

+23-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
alink="#0000ff">
1111
<H1>Frequently Asked Questions (FAQ) for PostgreSQL</H1>
1212

13-
<P>Last updated: Fri Oct 12 23:36:59 EDT 2007</P>
13+
<P>Last updated: Wed Oct 17 13:34:42 EDT 2007</P>
1414

1515
<P>Current maintainer: Bruce Momjian (<A href=
1616
"mailto:bruce@momjian.us">bruce@momjian.us</A>)
@@ -114,8 +114,11 @@ <H2 align="center">Operational Questions</H2>
114114
databases?<BR>
115115
<A href="#item4.18">4.18</A>) How do I return multiple rows or columns
116116
from a function?<BR>
117-
<A href="#item4.20">4.19</A>) What replication solutions are available?<BR>
118-
<A href="#item4.21">4.20</A>) Why are my table and column names not
117+
<A href="#item4.19">4.19</A>) Why do I get "relation with OID #####
118+
does not exist" errors when accessing temporary tables in PL/PgSQL
119+
functions?<BR>
120+
<A href="#item4.20">4.20</A>) What replication solutions are available?<BR>
121+
<A href="#item4.21">4.21</A>) Why are my table and column names not
119122
recognized in my query? Why is capitalization not preserved?<BR>
120123

121124

@@ -1041,7 +1044,21 @@ <H3 id="item4.18">4.18) How do I return multiple rows or
10411044
<a href="http://www.postgresql.org/docs/techdocs.17">
10421045
http://www.postgresql.org/docs/techdocs.17</a>.</P>
10431046

1044-
<H3 id="item4.19">4.19) What replication solutions are available?
1047+
<H3 id="item4.19">4.19) Why do I get "relation with OID #####
1048+
does not exist" errors when accessing temporary tables in PL/PgSQL
1049+
functions?</H3>
1050+
1051+
<P>In PostgreSQL versions < 8.3, PL/PgSQL caches function scripts, and
1052+
an unfortunate side effect is that if a PL/PgSQL function accesses a
1053+
temporary table, and that table is later dropped and recreated, and
1054+
the function called again, the function will fail because the cached
1055+
function contents still point to the old temporary table. The solution
1056+
is to use <SMALL>EXECUTE</SMALL> for temporary table access in
1057+
PL/PgSQL. This will cause the query to be reparsed every time.</P>
1058+
1059+
<P>This problem does not occur in PostgreSQL 8.3 and later.</P>
1060+
1061+
<H3 id="item4.20">4.20) What replication solutions are available?
10451062
</H3>
10461063

10471064
<P>Though "replication" is a single term, there are several technologies
@@ -1063,7 +1080,7 @@ <H3 id="item4.19">4.19) What replication solutions are available?
10631080
<P>There are also commercial and hardware-based replication solutions
10641081
available supporting a variety of replication models.</P>
10651082

1066-
<H3 id="item4.20">4.20) Why are my table and column names not
1083+
<H3 id="item4.21">4.21) Why are my table and column names not
10671084
recognized in my query? Why is capitalization not preserved?</H3>
10681085

10691086
<P>The most common cause of unrecognized names is the use of
@@ -1080,5 +1097,6 @@ <H3 id="item4.20">4.20) Why are my table and column names not
10801097
<LI>Use only lowercase characters in identifiers</LI>
10811098
<LI>Double-quote identifiers when referencing them in queries</LI>
10821099
</UL>
1100+
10831101
</BODY>
10841102
</HTML>

0 commit comments

Comments
 (0)