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

Fix pg_get_constraintdef() to ensure CHECK constraints are always shown

with required outer parentheses.  Breakage seems to be leftover from
domain-constraint patches.  This could be smarter about suppressing
extra parens, but at this stage of the release cycle I want certainty
not cuteness.
This commit is contained in:
Tom Lane
2003-10-04 18:22:59 +00:00
parent ec1fbbb546
commit b833c3d4a4
3 changed files with 23 additions and 64 deletions

View File

@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.107 2003/08/17 19:58:06 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.108 2003/10/04 18:22:59 tgl Exp $
*
* NOTES
* Eventually, the index information should go through here, too.
@ -1469,37 +1469,6 @@ get_typtype(Oid typid)
return '\0';
}
/*
* get_typname
* Returns the name of a given type.
*
* Returns a palloc'd copy of the string, or NULL if no such type.
*
* NOTE: since type name is not unique, be wary of code that uses this
* for anything except preparing error messages.
*/
char *
get_typname(Oid typid)
{
HeapTuple tp;
tp = SearchSysCache(TYPEOID,
ObjectIdGetDatum(typid),
0, 0, 0);
if (HeapTupleIsValid(tp))
{
Form_pg_type typtup = (Form_pg_type) GETSTRUCT(tp);
char *result;
result = pstrdup(NameStr(typtup->typname));
ReleaseSysCache(tp);
return result;
}
else
return NULL;
}
/*
* get_typ_typrelid
*