1996-08-28 03:59:28 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
1999-02-14 00:22:53 +01:00
|
|
|
* datum.h
|
2000-07-12 04:37:39 +02:00
|
|
|
* POSTGRES Datum (abstract data type) manipulation routines.
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
2000-07-12 04:37:39 +02:00
|
|
|
* These routines are driven by the 'typbyval' and 'typlen' information,
|
|
|
|
* which must previously have been obtained by the caller for the datatype
|
|
|
|
* of the Datum. (We do it this way because in most situations the caller
|
|
|
|
* can look up the info just once and use it for many per-datum operations.)
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
2010-01-02 17:58:17 +01:00
|
|
|
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
|
2000-01-26 06:58:53 +01:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
2010-01-02 17:58:17 +01:00
|
|
|
* $PostgreSQL: pgsql/src/include/utils/datum.h,v 1.26 2010/01/02 16:58:10 momjian Exp $
|
1996-08-28 03:59:28 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
1997-09-07 07:04:48 +02:00
|
|
|
#ifndef DATUM_H
|
|
|
|
#define DATUM_H
|
1996-08-28 03:59:28 +02:00
|
|
|
|
2000-07-12 04:37:39 +02:00
|
|
|
/*
|
|
|
|
* datumGetSize - find the "real" length of a datum
|
1996-08-28 03:59:28 +02:00
|
|
|
*/
|
2000-07-12 04:37:39 +02:00
|
|
|
extern Size datumGetSize(Datum value, bool typByVal, int typLen);
|
1996-08-28 03:59:28 +02:00
|
|
|
|
2000-07-12 04:37:39 +02:00
|
|
|
/*
|
|
|
|
* datumCopy - make a copy of a datum.
|
|
|
|
*
|
|
|
|
* If the datatype is pass-by-reference, memory is obtained with palloc().
|
1996-08-28 03:59:28 +02:00
|
|
|
*/
|
2000-07-12 04:37:39 +02:00
|
|
|
extern Datum datumCopy(Datum value, bool typByVal, int typLen);
|
1996-08-28 03:59:28 +02:00
|
|
|
|
2000-07-12 04:37:39 +02:00
|
|
|
/*
|
|
|
|
* datumFree - free a datum previously allocated by datumCopy, if any.
|
|
|
|
*
|
|
|
|
* Does nothing if datatype is pass-by-value.
|
1996-08-28 03:59:28 +02:00
|
|
|
*/
|
2000-07-12 04:37:39 +02:00
|
|
|
extern void datumFree(Datum value, bool typByVal, int typLen);
|
1996-08-28 03:59:28 +02:00
|
|
|
|
2000-07-12 04:37:39 +02:00
|
|
|
/*
|
1996-08-28 03:59:28 +02:00
|
|
|
* datumIsEqual
|
2000-07-12 04:37:39 +02:00
|
|
|
* return true if two datums of the same type are equal, false otherwise.
|
|
|
|
*
|
1996-08-28 03:59:28 +02:00
|
|
|
* XXX : See comments in the code for restrictions!
|
|
|
|
*/
|
2000-07-12 04:37:39 +02:00
|
|
|
extern bool datumIsEqual(Datum value1, Datum value2,
|
2001-03-22 05:01:46 +01:00
|
|
|
bool typByVal, int typLen);
|
2001-10-28 07:26:15 +01:00
|
|
|
|
2001-11-05 18:46:40 +01:00
|
|
|
#endif /* DATUM_H */
|