#include "utils/builtins.h"
#include "utils/lsyscache.h"
#include "utils/guc.h"
+#if PG_VERSION_NUM >= 90200
+#include "catalog/pg_class.h"
+#include "utils/rel.h"
+#include "utils/relcache.h"
+#include "utils/timestamp.h"
+#endif
#ifdef PG_MODULE_MAGIC
PG_MODULE_MAGIC;
foreach(l, namelist)
{
char *curname = (char *) lfirst(l);
- Oid relOid = RangeVarGetRelid(makeRangeVarFromNameList(stringToQualifiedNameList(curname)), true);
+ Oid relOid = RangeVarGetRelid(makeRangeVarFromNameList(stringToQualifiedNameList(curname)),
+#if PG_VERSION_NUM >= 90200
+ NoLock,
+#endif
+ true);
if (relOid == InvalidOid)
{
(queryDesc->operation == CMD_INSERT ||
queryDesc->operation == CMD_UPDATE ||
queryDesc->operation == CMD_DELETE ||
- (queryDesc->operation == CMD_SELECT && queryDesc->plannedstmt->intoClause)))
+#if PG_VERSION_NUM >= 90200
+ 0 /* (queryDesc->operation == CMD_SELECT && queryDesc->dest && queryDesc->dest == DestIntoRel) */
+#else
+ (queryDesc->operation == CMD_SELECT && queryDesc->plannedstmt->intoClause)
+#endif
+ ))
{
- if (queryDesc->plannedstmt->intoClause)
+#if PG_VERSION_NUM < 90200
+ if (queryDesc->operation == CMD_SELECT)
{
Oid relOid = RangeVarGetRelid(queryDesc->plannedstmt->intoClause->rel, true);
makeAnalyze(relOid, queryDesc->operation, naffected);
}
- else if (queryDesc->plannedstmt->resultRelations &&
+ else
+#endif
+ if (queryDesc->plannedstmt->resultRelations &&
queryDesc->plannedstmt->rtable)
{
ListCell *l;