summaryrefslogtreecommitdiff
path: root/src/backend/commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/commands')
-rw-r--r--src/backend/commands/analyze.c21
-rw-r--r--src/backend/commands/copy.c4
-rw-r--r--src/backend/commands/indexcmds.c5
-rw-r--r--src/backend/commands/opclasscmds.c6
-rw-r--r--src/backend/commands/portalcmds.c23
-rw-r--r--src/backend/commands/tablecmds.c10
6 files changed, 33 insertions, 36 deletions
diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c
index 2272d7bf3fb..858afc6c60f 100644
--- a/src/backend/commands/analyze.c
+++ b/src/backend/commands/analyze.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/analyze.c,v 1.58 2003/08/04 02:39:58 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/analyze.c,v 1.58.2.1 2003/09/07 04:36:47 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -390,7 +390,6 @@ examine_attribute(Relation onerel, int attnum)
{
Form_pg_attribute attr = onerel->rd_att->attrs[attnum - 1];
Operator func_operator;
- Oid oprrest;
HeapTuple typtuple;
Oid eqopr = InvalidOid;
Oid eqfunc = InvalidOid;
@@ -409,12 +408,8 @@ examine_attribute(Relation onerel, int attnum)
func_operator = equality_oper(attr->atttypid, true);
if (func_operator != NULL)
{
- oprrest = ((Form_pg_operator) GETSTRUCT(func_operator))->oprrest;
- if (oprrest == F_EQSEL)
- {
- eqopr = oprid(func_operator);
- eqfunc = oprfuncid(func_operator);
- }
+ eqopr = oprid(func_operator);
+ eqfunc = oprfuncid(func_operator);
ReleaseSysCache(func_operator);
}
if (!OidIsValid(eqfunc))
@@ -447,9 +442,7 @@ examine_attribute(Relation onerel, int attnum)
func_operator = ordering_oper(attr->atttypid, true);
if (func_operator != NULL)
{
- oprrest = ((Form_pg_operator) GETSTRUCT(func_operator))->oprrest;
- if (oprrest == F_SCALARLTSEL)
- ltopr = oprid(func_operator);
+ ltopr = oprid(func_operator);
ReleaseSysCache(func_operator);
}
stats->ltopr = ltopr;
@@ -694,6 +687,12 @@ pageloop:;
*/
*totalrows = floor((double) onerel->rd_nblocks * tuplesperpage + 0.5);
+ /*
+ * Emit some interesting relation info
+ */
+ elog(elevel, " pages = %d rows/page = %d rows = %.0f",
+ onerel->rd_nblocks, (int)tuplesperpage, *totalrows);
+
return numrows;
}
diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c
index bf798288f1b..280ae7f51d3 100644
--- a/src/backend/commands/copy.c
+++ b/src/backend/commands/copy.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.209 2003/08/13 18:56:21 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.209.2.1 2003/09/07 04:36:47 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -432,7 +432,7 @@ CopyGetData(void *databuf, int datasize)
avail = datasize;
pq_copymsgbytes(copy_msgbuf, databuf, avail);
databuf = (void *) ((char *) databuf + avail);
- datasize = -avail;
+ datasize -= avail;
}
break;
}
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 36baf4690e3..8a15f189c97 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/indexcmds.c,v 1.105 2003/08/04 02:39:58 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/indexcmds.c,v 1.105.2.1 2003/09/07 04:36:47 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -529,7 +529,8 @@ GetDefaultOpClass(Oid attrType, Oid accessMethodId)
* than one exact match, then someone put bogus entries in pg_opclass.
*
* The initial search is done by namespace.c so that we only consider
- * opclasses visible in the current namespace search path.
+ * opclasses visible in the current namespace search path. (See also
+ * typcache.c, which applies the same logic, but over all opclasses.)
*/
for (opclass = OpclassGetCandidates(accessMethodId);
opclass != NULL;
diff --git a/src/backend/commands/opclasscmds.c b/src/backend/commands/opclasscmds.c
index 0677751ead4..300a80aeb0d 100644
--- a/src/backend/commands/opclasscmds.c
+++ b/src/backend/commands/opclasscmds.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/opclasscmds.c,v 1.17 2003/08/04 02:39:58 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/opclasscmds.c,v 1.17.2.1 2003/09/07 04:36:47 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -261,7 +261,9 @@ DefineOpClass(CreateOpClassStmt *stmt)
/*
* If we are creating a default opclass, check there isn't one
- * already. (XXX should we restrict this test to visible opclasses?)
+ * already. (Note we do not restrict this test to visible opclasses;
+ * this ensures that typcache.c can find unique solutions to its
+ * questions.)
*/
if (stmt->isDefault)
{
diff --git a/src/backend/commands/portalcmds.c b/src/backend/commands/portalcmds.c
index c11b48db4c1..7a95959c98e 100644
--- a/src/backend/commands/portalcmds.c
+++ b/src/backend/commands/portalcmds.c
@@ -14,7 +14,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/portalcmds.c,v 1.23 2003/08/08 21:41:32 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/portalcmds.c,v 1.23.2.1 2003/09/07 04:36:47 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -88,10 +88,9 @@ PerformCursorOpen(DeclareCursorStmt *stmt)
/*
* Create a portal and copy the query and plan into its memory
- * context. (If a duplicate cursor name already exists, warn and drop
- * it.)
+ * context.
*/
- portal = CreatePortal(stmt->portalname, true, false);
+ portal = CreatePortal(stmt->portalname, false, false);
oldContext = MemoryContextSwitchTo(PortalGetHeapMemory(portal));
@@ -168,13 +167,10 @@ PerformPortalFetch(FetchStmt *stmt,
portal = GetPortalByName(stmt->portalname);
if (!PortalIsValid(portal))
{
- /* FIXME: shouldn't this be an ERROR? */
- ereport(WARNING,
+ ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_CURSOR),
- errmsg("portal \"%s\" does not exist", stmt->portalname)));
- if (completionTag)
- strcpy(completionTag, stmt->ismove ? "MOVE 0" : "FETCH 0");
- return;
+ errmsg("cursor \"%s\" does not exist", stmt->portalname)));
+ return; /* keep compiler happy */
}
/* Adjust dest if needed. MOVE wants destination None */
@@ -218,11 +214,10 @@ PerformPortalClose(const char *name)
portal = GetPortalByName(name);
if (!PortalIsValid(portal))
{
- ereport(WARNING,
+ ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_CURSOR),
- errmsg("portal \"%s\" does not exist", name),
- errfunction("PerformPortalClose"))); /* for ecpg */
- return;
+ errmsg("cursor \"%s\" does not exist", name)));
+ return; /* keep compiler happy */
}
/*
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index 77885802335..ecbdad05195 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/tablecmds.c,v 1.79 2003/08/08 21:41:32 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/tablecmds.c,v 1.79.2.1 2003/09/07 04:36:47 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -2008,7 +2008,7 @@ AlterTableAlterColumnDropNotNull(Oid myrelid, bool recurse,
}
}
- /* -= now do the thing on this relation =- */
+ /* now do the thing on this relation */
/*
* get the number of the attribute
@@ -2152,7 +2152,7 @@ AlterTableAlterColumnSetNotNull(Oid myrelid, bool recurse,
}
}
- /* -= now do the thing on this relation =- */
+ /* now do the thing on this relation */
/*
* get the number of the attribute
@@ -2280,7 +2280,7 @@ AlterTableAlterColumnDefault(Oid myrelid, bool recurse,
}
}
- /* -= now do the thing on this relation =- */
+ /* now do the thing on this relation */
/*
* get the number of the attribute
@@ -2445,7 +2445,7 @@ AlterTableAlterColumnFlags(Oid myrelid, bool recurse,
}
}
- /* -= now do the thing on this relation =- */
+ /* now do the thing on this relation */
attrelation = heap_openr(AttributeRelationName, RowExclusiveLock);