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

Updated the pg_get_constraintdef() to use conbin. Update pg_dump to use

pg_get_constraintdef() for >= 70400.

Rod Taylor <rbt@rbt.ca>
This commit is contained in:
Bruce Momjian
2003-06-25 03:56:31 +00:00
parent be94f198c3
commit ca64391d6c
4 changed files with 105 additions and 15 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.97 2003/06/24 23:14:46 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.98 2003/06/25 03:56:31 momjian Exp $
*
* NOTES
* Eventually, the index information should go through here, too.
@ -1443,6 +1443,37 @@ 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 relation.
*
* 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
*