1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-05 07:41:25 +03:00

Make VACUUM handle schema-qualified relation names properly.

This commit is contained in:
Tom Lane
2002-04-02 01:03:07 +00:00
parent 789ddcb5fe
commit 1dc43ea75f
6 changed files with 152 additions and 142 deletions

View File

@@ -18,7 +18,7 @@
* Portions Copyright (c) 2000-2001, PostgreSQL Global Development Group
* Copyright 1999 Jan Wieck
*
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ri_triggers.c,v 1.35 2002/04/01 22:36:10 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ri_triggers.c,v 1.36 2002/04/02 01:03:07 tgl Exp $
*
* ----------
*/
@@ -33,11 +33,10 @@
#include "postgres.h"
#include "catalog/pg_namespace.h"
#include "catalog/pg_operator.h"
#include "commands/trigger.h"
#include "executor/spi_priv.h"
#include "nodes/makefuncs.h"
#include "utils/lsyscache.h"
#include "miscadmin.h"
@@ -2954,18 +2953,7 @@ quoteOneName(char *buffer, const char *name)
static void
quoteRelationName(char *buffer, Relation rel)
{
HeapTuple tuple;
char *nsname;
tuple = SearchSysCache(NAMESPACEOID,
ObjectIdGetDatum(RelationGetNamespace(rel)),
0, 0, 0);
if (!HeapTupleIsValid(tuple))
elog(ERROR, "Failed to lookup namespace %u of relation %s",
RelationGetNamespace(rel), RelationGetRelationName(rel));
nsname = NameStr(((Form_pg_namespace) GETSTRUCT(tuple))->nspname);
quoteOneName(buffer, nsname);
ReleaseSysCache(tuple);
quoteOneName(buffer, get_namespace_name(RelationGetNamespace(rel)));
buffer += strlen(buffer);
*buffer++ = '.';
quoteOneName(buffer, RelationGetRelationName(rel));