aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2011-07-04 14:28:05 -0400
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2011-07-04 14:33:44 -0400
commitd665162077862ef9e5886f870bf5ce909fc9342c (patch)
treee7af9e869f947d7a454a6f733268ff13fa11302f /src
parent9f084527a48f7c9ceb995d7bc39da63ae1941a3c (diff)
downloadpostgresql-d665162077862ef9e5886f870bf5ce909fc9342c.tar.gz
postgresql-d665162077862ef9e5886f870bf5ce909fc9342c.zip
Don't try to use a constraint name as domain name
The bug that caused this to be discovered is that the code was trying to dereference a NULL or ill-defined pointer, as reported by Michael Mueller; but what it was doing was wrong anyway, per Heikki. This patch is Heikki's suggested fix.
Diffstat (limited to 'src')
-rw-r--r--src/backend/commands/typecmds.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/commands/typecmds.c b/src/backend/commands/typecmds.c
index c29f44cbf6a..2a2ff5387e5 100644
--- a/src/backend/commands/typecmds.c
+++ b/src/backend/commands/typecmds.c
@@ -2096,13 +2096,13 @@ AlterDomainValidateConstraint(List *names, char *constrName)
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("constraint \"%s\" of domain \"%s\" does not exist",
- constrName, NameStr(con->conname))));
+ constrName, TypeNameToString(typename))));
if (con->contype != CONSTRAINT_CHECK)
ereport(ERROR,
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
errmsg("constraint \"%s\" of domain \"%s\" is not a check constraint",
- constrName, NameStr(con->conname))));
+ constrName, TypeNameToString(typename))));
val = SysCacheGetAttr(CONSTROID, tuple,
Anum_pg_constraint_conbin,