Re: Prepared statements fail after schema changes with surprising error

Dickson S. Guedes <listas@guedesoft.net>

From: "Dickson S. Guedes" <listas@guedesoft.net>
To: Peter van Hardenberg <pvh@pvh.ca>
Cc: "pgsql-hackers@postgresql.org Hackers" <pgsql-hackers@postgresql.org>
Date: 2013-01-22T01:17:20Z
Lists: pgsql-hackers
2013/1/21 Peter van Hardenberg <pvh@pvh.ca>:
> A user reported an interesting issue today. After restoring a dump created
> with --clean on a running application in his development environment his
> application started complaining of missing tables despite those tables very
> clearly existing.
>
> After a little thinking, we determined that this was due to the now-default
> behaviour of Rails to create prepared statements for most queries. The
> prepared statements error out because the old relation they point to is
> missing, but this gives a misleading report thus:
>
> PG::Error: ERROR: relation "xxx" does not exist

Isn't that something with search_path?

-- 
Dickson S. Guedes
mail/xmpp: guedes@guedesoft.net - skype: guediz
http://github.com/guedes - http://guedesoft.net
http://www.postgresql.org.br