1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +03:00

Allow varchar() to only store needed bytes. Remove PALLOC,PALLOCTYPE,PFREE. Clean up use of VARDATA.

This commit is contained in:
Bruce Momjian
1998-01-07 18:47:07 +00:00
parent 7a2a7d436d
commit e6c6146eb8
16 changed files with 253 additions and 303 deletions

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/oid.c,v 1.12 1997/10/25 05:21:54 thomas Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/oid.c,v 1.13 1998/01/07 18:46:50 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -150,11 +150,11 @@ oid_text(Oid oid)
str = oidout(oid);
len = (strlen(str) + VARHDRSZ);
result = PALLOC(len);
result = palloc(len);
VARSIZE(result) = len;
memmove(VARDATA(result), str, (len-VARHDRSZ));
PFREE(str);
pfree(str);
return(result);
} /* oid_text() */
@ -169,12 +169,12 @@ text_oid(text *string)
len = (VARSIZE(string) - VARHDRSZ);
str = PALLOC(len+1);
str = palloc(len+1);
memmove(str, VARDATA(string), len);
*(str+len) = '\0';
result = oidin(str);
PFREE(str);
pfree(str);
return(result);
} /* oid_text() */