Commit b1ee615a authored by Tom Lane's avatar Tom Lane

COPY BINARY uses the new binary I/O routines. Update a few more datatypes

so that COPY BINARY regression test passes.
parent 38d9919d
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/copy.sgml,v 1.45 2003/05/07 22:23:27 tgl Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/copy.sgml,v 1.46 2003/05/09 21:19:48 tgl Exp $
PostgreSQL documentation PostgreSQL documentation
--> -->
...@@ -541,28 +541,22 @@ ZW ZIMBABWE ...@@ -541,28 +541,22 @@ ZW ZIMBABWE
</para> </para>
<para> <para>
XXX the following example is OBSOLETE and needs to be updated for the The following is the same data, output in binary format.
7.4 binary format: The data is shown after filtering through the
</para>
<para>
The following is the same data, output in binary format on a
Linux/i586 machine. The data is shown after filtering through the
Unix utility <command>od -c</command>. The table has three columns; Unix utility <command>od -c</command>. The table has three columns;
the first has type <type>char(2)</type>, the second has type <type>text</type>, the first has type <type>char(2)</type>, the second has type <type>text</type>,
and the third has type <type>integer</type>. All the rows have a null value and the third has type <type>integer</type>. All the rows have a null value
in the third column. in the third column.
<programlisting> <programlisting>
0000000 P G B C O P Y \n 377 \r \n \0 004 003 002 001 0000000 P G C O P Y \n 377 \r \n \0 \0 \0 \0 \0 \0
0000020 \0 \0 \0 \0 \0 \0 \0 \0 003 \0 377 377 006 \0 \0 \0 0000020 \0 \0 \0 \0 003 \0 \0 \0 002 A F \0 \0 \0 013 A
0000040 A F 377 377 017 \0 \0 \0 A F G H A N I S 0000040 F G H A N I S T A N 377 377 377 377 \0 003
0000060 T A N \0 \0 003 \0 377 377 006 \0 \0 \0 A L 377 0000060 \0 \0 \0 002 A L \0 \0 \0 007 A L B A N I
0000100 377 \v \0 \0 \0 A L B A N I A \0 \0 003 \0 0000100 A 377 377 377 377 \0 003 \0 \0 \0 002 D Z \0 \0 \0
0000120 377 377 006 \0 \0 \0 D Z 377 377 \v \0 \0 \0 A L 0000120 007 A L G E R I A 377 377 377 377 \0 003 \0 \0
0000140 G E R I A \0 \0 003 \0 377 377 006 \0 \0 \0 Z 0000140 \0 002 Z M \0 \0 \0 006 Z A M B I A 377 377
0000160 M 377 377 \n \0 \0 \0 Z A M B I A \0 \0 003 0000160 377 377 \0 003 \0 \0 \0 002 Z W \0 \0 \0 \b Z I
0000200 \0 377 377 006 \0 \0 \0 Z W 377 377 \f \0 \0 \0 Z 0000200 M B A B W E 377 377 377 377 377 377
0000220 I M B A B W E \0 \0 377 377
</programlisting> </programlisting>
</para> </para>
</refsect1> </refsect1>
......
This diff is collapsed.
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Header: /cvsroot/pgsql/src/backend/libpq/pqformat.c,v 1.30 2003/05/09 15:44:40 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/libpq/pqformat.c,v 1.31 2003/05/09 21:19:49 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -35,6 +35,8 @@ ...@@ -35,6 +35,8 @@
* pq_sendbyte - append a raw byte to a StringInfo buffer * pq_sendbyte - append a raw byte to a StringInfo buffer
* pq_sendint - append a binary integer to a StringInfo buffer * pq_sendint - append a binary integer to a StringInfo buffer
* pq_sendint64 - append a binary 8-byte int to a StringInfo buffer * pq_sendint64 - append a binary 8-byte int to a StringInfo buffer
* pq_sendfloat4 - append a float4 to a StringInfo buffer
* pq_sendfloat8 - append a float8 to a StringInfo buffer
* pq_sendbytes - append raw data to a StringInfo buffer * pq_sendbytes - append raw data to a StringInfo buffer
* pq_sendcountedtext - append a counted text string (with character set conversion) * pq_sendcountedtext - append a counted text string (with character set conversion)
* pq_sendtext - append a text string (with conversion) * pq_sendtext - append a text string (with conversion)
...@@ -56,6 +58,8 @@ ...@@ -56,6 +58,8 @@
* pq_getmsgbyte - get a raw byte from a message buffer * pq_getmsgbyte - get a raw byte from a message buffer
* pq_getmsgint - get a binary integer from a message buffer * pq_getmsgint - get a binary integer from a message buffer
* pq_getmsgint64 - get a binary 8-byte int from a message buffer * pq_getmsgint64 - get a binary 8-byte int from a message buffer
* pq_getmsgfloat4 - get a float4 from a message buffer
* pq_getmsgfloat8 - get a float8 from a message buffer
* pq_getmsgbytes - get raw data from a message buffer * pq_getmsgbytes - get raw data from a message buffer
* pq_copymsgbytes - copy raw data from a message buffer * pq_copymsgbytes - copy raw data from a message buffer
* pq_getmsgtext - get a counted text string (with conversion) * pq_getmsgtext - get a counted text string (with conversion)
...@@ -261,6 +265,82 @@ pq_sendint64(StringInfo buf, int64 i) ...@@ -261,6 +265,82 @@ pq_sendint64(StringInfo buf, int64 i)
appendBinaryStringInfo(buf, (char *) &n32, 4); appendBinaryStringInfo(buf, (char *) &n32, 4);
} }
/* --------------------------------
* pq_sendfloat4 - append a float4 to a StringInfo buffer
*
* The point of this routine is to localize knowledge of the external binary
* representation of float4, which is a component of several datatypes.
*
* We currently assume that float4 should be byte-swapped in the same way
* as int4. This rule is not perfect but it gives us portability across
* most IEEE-float-using architectures.
* --------------------------------
*/
void
pq_sendfloat4(StringInfo buf, float4 f)
{
union
{
float4 f;
uint32 i;
} swap;
swap.f = f;
swap.i = htonl(swap.i);
appendBinaryStringInfo(buf, (char *) &swap.i, 4);
}
/* --------------------------------
* pq_sendfloat8 - append a float8 to a StringInfo buffer
*
* The point of this routine is to localize knowledge of the external binary
* representation of float8, which is a component of several datatypes.
*
* We currently assume that float8 should be byte-swapped in the same way
* as int8. This rule is not perfect but it gives us portability across
* most IEEE-float-using architectures.
* --------------------------------
*/
void
pq_sendfloat8(StringInfo buf, float8 f)
{
#ifdef INT64_IS_BUSTED
union
{
float8 f;
uint32 h[2];
} swap;
swap.f = f;
swap.h[0] = htonl(swap.h[0]);
swap.h[1] = htonl(swap.h[1]);
/* Have to figure out endianness by testing... */
if (((uint32) 1) == htonl((uint32) 1))
{
/* machine seems to be big-endian, send h[0] first */
appendBinaryStringInfo(buf, (char *) &swap.h[0], 4);
appendBinaryStringInfo(buf, (char *) &swap.h[1], 4);
}
else
{
/* machine seems to be little-endian, send h[1] first */
appendBinaryStringInfo(buf, (char *) &swap.h[1], 4);
appendBinaryStringInfo(buf, (char *) &swap.h[0], 4);
}
#else
union
{
float8 f;
int64 i;
} swap;
swap.f = f;
pq_sendint64(buf, swap.i);
#endif
}
/* -------------------------------- /* --------------------------------
* pq_endmessage - send the completed message to the frontend * pq_endmessage - send the completed message to the frontend
* *
...@@ -432,6 +512,67 @@ pq_getmsgint64(StringInfo msg) ...@@ -432,6 +512,67 @@ pq_getmsgint64(StringInfo msg)
return result; return result;
} }
/* --------------------------------
* pq_getmsgfloat4 - get a float4 from a message buffer
*
* See notes for pq_sendfloat4.
* --------------------------------
*/
float4
pq_getmsgfloat4(StringInfo msg)
{
union
{
float4 f;
uint32 i;
} swap;
swap.i = pq_getmsgint(msg, 4);
return swap.f;
}
/* --------------------------------
* pq_getmsgfloat8 - get a float8 from a message buffer
*
* See notes for pq_sendfloat8.
* --------------------------------
*/
float8
pq_getmsgfloat8(StringInfo msg)
{
#ifdef INT64_IS_BUSTED
union
{
float8 f;
uint32 h[2];
} swap;
/* Have to figure out endianness by testing... */
if (((uint32) 1) == htonl((uint32) 1))
{
/* machine seems to be big-endian, receive h[0] first */
swap.h[0] = pq_getmsgint(msg, 4);
swap.h[1] = pq_getmsgint(msg, 4);
}
else
{
/* machine seems to be little-endian, receive h[1] first */
swap.h[1] = pq_getmsgint(msg, 4);
swap.h[0] = pq_getmsgint(msg, 4);
}
return swap.f;
#else
union
{
float8 f;
int64 i;
} swap;
swap.i = pq_getmsgint64(msg);
return swap.f;
#endif
}
/* -------------------------------- /* --------------------------------
* pq_getmsgbytes - get raw data from a message buffer * pq_getmsgbytes - get raw data from a message buffer
* *
......
...@@ -8,16 +8,18 @@ ...@@ -8,16 +8,18 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.86 2003/05/09 16:31:24 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.87 2003/05/09 21:19:49 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
/*---------- /*----------
* OLD COMMENTS * OLD COMMENTS
* Basic float4 ops: * Basic float4 ops:
* float4in, float4out, float4abs, float4um, float4up * float4in, float4out, float4recv, float4send
* float4abs, float4um, float4up
* Basic float8 ops: * Basic float8 ops:
* float8in, float8out, float8abs, float8um, float8up * float8in, float8out, float8recv, float8send
* float8abs, float8um, float8up
* Arithmetic operators: * Arithmetic operators:
* float4pl, float4mi, float4mul, float4div * float4pl, float4mi, float4mul, float4div
* float8pl, float8mi, float8mul, float8div * float8pl, float8mi, float8mul, float8div
...@@ -63,6 +65,7 @@ ...@@ -63,6 +65,7 @@
#include "catalog/pg_type.h" #include "catalog/pg_type.h"
#include "fmgr.h" #include "fmgr.h"
#include "libpq/pqformat.h"
#include "utils/array.h" #include "utils/array.h"
#include "utils/builtins.h" #include "utils/builtins.h"
...@@ -242,6 +245,31 @@ float4out(PG_FUNCTION_ARGS) ...@@ -242,6 +245,31 @@ float4out(PG_FUNCTION_ARGS)
PG_RETURN_CSTRING(ascii); PG_RETURN_CSTRING(ascii);
} }
/*
* float4recv - converts external binary format to float4
*/
Datum
float4recv(PG_FUNCTION_ARGS)
{
StringInfo buf = (StringInfo) PG_GETARG_POINTER(0);
PG_RETURN_FLOAT4(pq_getmsgfloat4(buf));
}
/*
* float4send - converts float4 to binary format
*/
Datum
float4send(PG_FUNCTION_ARGS)
{
float4 num = PG_GETARG_FLOAT4(0);
StringInfoData buf;
pq_begintypsend(&buf);
pq_sendfloat4(&buf, num);
PG_RETURN_BYTEA_P(pq_endtypsend(&buf));
}
/* /*
* float8in - converts "num" to float8 * float8in - converts "num" to float8
* restricted syntax: * restricted syntax:
...@@ -280,7 +308,6 @@ float8in(PG_FUNCTION_ARGS) ...@@ -280,7 +308,6 @@ float8in(PG_FUNCTION_ARGS)
PG_RETURN_FLOAT8(val); PG_RETURN_FLOAT8(val);
} }
/* /*
* float8out - converts float8 number to a string * float8out - converts float8 number to a string
* using a standard output format * using a standard output format
...@@ -310,6 +337,32 @@ float8out(PG_FUNCTION_ARGS) ...@@ -310,6 +337,32 @@ float8out(PG_FUNCTION_ARGS)
PG_RETURN_CSTRING(ascii); PG_RETURN_CSTRING(ascii);
} }
/*
* float8recv - converts external binary format to float8
*/
Datum
float8recv(PG_FUNCTION_ARGS)
{
StringInfo buf = (StringInfo) PG_GETARG_POINTER(0);
PG_RETURN_FLOAT8(pq_getmsgfloat8(buf));
}
/*
* float8send - converts float8 to binary format
*/
Datum
float8send(PG_FUNCTION_ARGS)
{
float8 num = PG_GETARG_FLOAT8(0);
StringInfoData buf;
pq_begintypsend(&buf);
pq_sendfloat8(&buf, num);
PG_RETURN_BYTEA_P(pq_endtypsend(&buf));
}
/* ========== PUBLIC ROUTINES ========== */ /* ========== PUBLIC ROUTINES ========== */
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.75 2003/03/11 21:01:33 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.76 2003/05/09 21:19:49 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -19,11 +19,11 @@ ...@@ -19,11 +19,11 @@
#include <float.h> #include <float.h>
#include <ctype.h> #include <ctype.h>
#include "libpq/pqformat.h"
#include "utils/builtins.h" #include "utils/builtins.h"
#include "utils/geo_decls.h" #include "utils/geo_decls.h"
#ifndef M_PI #ifndef M_PI
/* from my RH5.2 gcc math.h file - thomas 2000-04-03 */
#define M_PI 3.14159265358979323846 #define M_PI 3.14159265358979323846
#endif #endif
...@@ -1589,6 +1589,36 @@ point_out(PG_FUNCTION_ARGS) ...@@ -1589,6 +1589,36 @@ point_out(PG_FUNCTION_ARGS)
PG_RETURN_CSTRING(path_encode(-1, 1, pt)); PG_RETURN_CSTRING(path_encode(-1, 1, pt));
} }
/*
* point_recv - converts external binary format to point
*/
Datum
point_recv(PG_FUNCTION_ARGS)
{
StringInfo buf = (StringInfo) PG_GETARG_POINTER(0);
Point *point;
point = (Point *) palloc(sizeof(Point));
point->x = pq_getmsgfloat8(buf);
point->y = pq_getmsgfloat8(buf);
PG_RETURN_POINT_P(point);
}
/*
* point_send - converts point to binary format
*/
Datum
point_send(PG_FUNCTION_ARGS)
{
Point *pt = PG_GETARG_POINT_P(0);
StringInfoData buf;
pq_begintypsend(&buf);
pq_sendfloat8(&buf, pt->x);
pq_sendfloat8(&buf, pt->y);
PG_RETURN_BYTEA_P(pq_endtypsend(&buf));
}
static Point * static Point *
point_construct(double x, double y) point_construct(double x, double y)
......
...@@ -2,8 +2,10 @@ ...@@ -2,8 +2,10 @@
* *
* name.c * name.c
* Functions for the built-in type "name". * Functions for the built-in type "name".
*
* name replaces char16 and is carefully implemented so that it * name replaces char16 and is carefully implemented so that it
* is a string of length NAMEDATALEN. DO NOT use hard-coded constants anywhere * is a string of physical length NAMEDATALEN.
* DO NOT use hard-coded constants anywhere
* always use NAMEDATALEN as the symbolic constant! - jolly 8/21/95 * always use NAMEDATALEN as the symbolic constant! - jolly 8/21/95
* *
* *
...@@ -12,7 +14,7 @@ ...@@ -12,7 +14,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/name.c,v 1.44 2003/04/27 23:22:13 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/name.c,v 1.45 2003/05/09 21:19:49 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -20,11 +22,13 @@ ...@@ -20,11 +22,13 @@
#include "catalog/namespace.h" #include "catalog/namespace.h"
#include "catalog/pg_type.h" #include "catalog/pg_type.h"
#include "libpq/pqformat.h"
#include "mb/pg_wchar.h"
#include "miscadmin.h" #include "miscadmin.h"
#include "utils/array.h" #include "utils/array.h"
#include "utils/builtins.h" #include "utils/builtins.h"
#include "utils/lsyscache.h" #include "utils/lsyscache.h"
#include "mb/pg_wchar.h"
/***************************************************************************** /*****************************************************************************
* USER I/O ROUTINES (none) * * USER I/O ROUTINES (none) *
...@@ -53,9 +57,7 @@ namein(PG_FUNCTION_ARGS) ...@@ -53,9 +57,7 @@ namein(PG_FUNCTION_ARGS)
len = pg_mbcliplen(s, len, NAMEDATALEN - 1); len = pg_mbcliplen(s, len, NAMEDATALEN - 1);
result = (NameData *) palloc(NAMEDATALEN); result = (NameData *) palloc0(NAMEDATALEN);
/* always keep it null-padded */
memset(result, 0, NAMEDATALEN);
memcpy(NameStr(*result), s, len); memcpy(NameStr(*result), s, len);
PG_RETURN_NAME(result); PG_RETURN_NAME(result);
...@@ -72,6 +74,40 @@ nameout(PG_FUNCTION_ARGS) ...@@ -72,6 +74,40 @@ nameout(PG_FUNCTION_ARGS)
PG_RETURN_CSTRING(pstrdup(NameStr(*s))); PG_RETURN_CSTRING(pstrdup(NameStr(*s)));
} }
/*
* namerecv - converts external binary format to name
*/
Datum
namerecv(PG_FUNCTION_ARGS)
{
StringInfo buf = (StringInfo) PG_GETARG_POINTER(0);
Name result;
char *str;
int nbytes;
str = pq_getmsgtext(buf, buf->len - buf->cursor, &nbytes);
if (nbytes >= NAMEDATALEN)
elog(ERROR, "namerecv: input name too long");
result = (NameData *) palloc0(NAMEDATALEN);
memcpy(result, str, nbytes);
pfree(str);
PG_RETURN_NAME(result);
}
/*
* namesend - converts name to binary format
*/
Datum
namesend(PG_FUNCTION_ARGS)
{
Name s = PG_GETARG_NAME(0);
StringInfoData buf;
pq_begintypsend(&buf);
pq_sendtext(&buf, NameStr(*s), strlen(NameStr(*s)));
PG_RETURN_BYTEA_P(pq_endtypsend(&buf));
}
/***************************************************************************** /*****************************************************************************
* PUBLIC ROUTINES * * PUBLIC ROUTINES *
...@@ -283,24 +319,3 @@ current_schemas(PG_FUNCTION_ARGS) ...@@ -283,24 +319,3 @@ current_schemas(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(array); PG_RETURN_POINTER(array);
} }
/*****************************************************************************
* PRIVATE ROUTINES *
*****************************************************************************/
#ifdef NOT_USED
uint32
NameComputeLength(Name name)
{
char *charP;
int length;
for (length = 0, charP = NameStr(*name);
length < NAMEDATALEN && *charP != '\0';
length++, charP++)
;
return (uint32) length;
}
#endif
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: catversion.h,v 1.188 2003/05/09 15:44:40 tgl Exp $ * $Id: catversion.h,v 1.189 2003/05/09 21:19:49 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -53,6 +53,6 @@ ...@@ -53,6 +53,6 @@
*/ */
/* yyyymmddN */ /* yyyymmddN */
#define CATALOG_VERSION_NO 200305091 #define CATALOG_VERSION_NO 200305092
#endif #endif
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: pg_proc.h,v 1.295 2003/05/09 15:44:40 tgl Exp $ * $Id: pg_proc.h,v 1.296 2003/05/09 21:19:49 tgl Exp $
* *
* NOTES * NOTES
* The script catalog/genbki.sh reads this file and generates .bki * The script catalog/genbki.sh reads this file and generates .bki
...@@ -3197,6 +3197,22 @@ DATA(insert OID = 2420 ( oidvectorrecv PGNSP PGUID 12 f f t f i 1 30 "2281" ...@@ -3197,6 +3197,22 @@ DATA(insert OID = 2420 ( oidvectorrecv PGNSP PGUID 12 f f t f i 1 30 "2281"
DESCR("I/O"); DESCR("I/O");
DATA(insert OID = 2421 ( oidvectorsend PGNSP PGUID 12 f f t f i 1 17 "30" oidvectorsend - _null_ )); DATA(insert OID = 2421 ( oidvectorsend PGNSP PGUID 12 f f t f i 1 17 "30" oidvectorsend - _null_ ));
DESCR("I/O"); DESCR("I/O");
DATA(insert OID = 2422 ( namerecv PGNSP PGUID 12 f f t f s 1 19 "2281" namerecv - _null_ ));
DESCR("I/O");
DATA(insert OID = 2423 ( namesend PGNSP PGUID 12 f f t f s 1 17 "19" namesend - _null_ ));
DESCR("I/O");
DATA(insert OID = 2424 ( float4recv PGNSP PGUID 12 f f t f i 1 700 "2281" float4recv - _null_ ));
DESCR("I/O");
DATA(insert OID = 2425 ( float4send PGNSP PGUID 12 f f t f i 1 17 "700" float4send - _null_ ));
DESCR("I/O");
DATA(insert OID = 2426 ( float8recv PGNSP PGUID 12 f f t f i 1 701 "2281" float8recv - _null_ ));
DESCR("I/O");
DATA(insert OID = 2427 ( float8send PGNSP PGUID 12 f f t f i 1 17 "701" float8send - _null_ ));
DESCR("I/O");
DATA(insert OID = 2428 ( point_recv PGNSP PGUID 12 f f t f i 1 600 "2281" point_recv - _null_ ));
DESCR("I/O");
DATA(insert OID = 2429 ( point_send PGNSP PGUID 12 f f t f i 1 17 "600" point_send - _null_ ));
DESCR("I/O");
/* /*
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: pg_type.h,v 1.142 2003/05/09 15:44:41 tgl Exp $ * $Id: pg_type.h,v 1.143 2003/05/09 21:19:50 tgl Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
...@@ -250,8 +250,8 @@ DATA(insert OID = 18 ( char PGNSP PGUID 1 t b t \054 0 0 charin charout - - ...@@ -250,8 +250,8 @@ DATA(insert OID = 18 ( char PGNSP PGUID 1 t b t \054 0 0 charin charout - -
DESCR("single character"); DESCR("single character");
#define CHAROID 18 #define CHAROID 18
DATA(insert OID = 19 ( name PGNSP PGUID NAMEDATALEN f b t \054 0 18 namein nameout - - i p f 0 -1 0 _null_ _null_ )); DATA(insert OID = 19 ( name PGNSP PGUID NAMEDATALEN f b t \054 0 18 namein nameout namerecv namesend i p f 0 -1 0 _null_ _null_ ));
DESCR("31-character type for storing system identifiers"); DESCR("63-character type for storing system identifiers");
#define NAMEOID 19 #define NAMEOID 19
DATA(insert OID = 20 ( int8 PGNSP PGUID 8 f b t \054 0 0 int8in int8out int8recv int8send d p f 0 -1 0 _null_ _null_ )); DATA(insert OID = 20 ( int8 PGNSP PGUID 8 f b t \054 0 0 int8in int8out int8recv int8send d p f 0 -1 0 _null_ _null_ ));
...@@ -323,7 +323,7 @@ DESCR("storage manager"); ...@@ -323,7 +323,7 @@ DESCR("storage manager");
/* OIDS 500 - 599 */ /* OIDS 500 - 599 */
/* OIDS 600 - 699 */ /* OIDS 600 - 699 */
DATA(insert OID = 600 ( point PGNSP PGUID 16 f b t \054 0 701 point_in point_out - - d p f 0 -1 0 _null_ _null_ )); DATA(insert OID = 600 ( point PGNSP PGUID 16 f b t \054 0 701 point_in point_out point_recv point_send d p f 0 -1 0 _null_ _null_ ));
DESCR("geometric point '(x, y)'"); DESCR("geometric point '(x, y)'");
#define POINTOID 600 #define POINTOID 600
DATA(insert OID = 601 ( lseg PGNSP PGUID 32 f b t \054 0 600 lseg_in lseg_out - - d p f 0 -1 0 _null_ _null_ )); DATA(insert OID = 601 ( lseg PGNSP PGUID 32 f b t \054 0 600 lseg_in lseg_out - - d p f 0 -1 0 _null_ _null_ ));
...@@ -347,10 +347,10 @@ DESCR(""); ...@@ -347,10 +347,10 @@ DESCR("");
/* OIDS 700 - 799 */ /* OIDS 700 - 799 */
DATA(insert OID = 700 ( float4 PGNSP PGUID 4 f b t \054 0 0 float4in float4out - - i p f 0 -1 0 _null_ _null_ )); DATA(insert OID = 700 ( float4 PGNSP PGUID 4 f b t \054 0 0 float4in float4out float4recv float4send i p f 0 -1 0 _null_ _null_ ));
DESCR("single-precision floating point number, 4-byte storage"); DESCR("single-precision floating point number, 4-byte storage");
#define FLOAT4OID 700 #define FLOAT4OID 700
DATA(insert OID = 701 ( float8 PGNSP PGUID 8 f b t \054 0 0 float8in float8out - - d p f 0 -1 0 _null_ _null_ )); DATA(insert OID = 701 ( float8 PGNSP PGUID 8 f b t \054 0 0 float8in float8out float8recv float8send d p f 0 -1 0 _null_ _null_ ));
DESCR("double-precision floating point number, 8-byte storage"); DESCR("double-precision floating point number, 8-byte storage");
#define FLOAT8OID 701 #define FLOAT8OID 701
DATA(insert OID = 702 ( abstime PGNSP PGUID 4 t b t \054 0 0 nabstimein nabstimeout - - i p f 0 -1 0 _null_ _null_ )); DATA(insert OID = 702 ( abstime PGNSP PGUID 4 t b t \054 0 0 nabstimein nabstimeout - - i p f 0 -1 0 _null_ _null_ ));
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: pqformat.h,v 1.17 2003/05/09 15:44:42 tgl Exp $ * $Id: pqformat.h,v 1.18 2003/05/09 21:19:50 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -24,6 +24,8 @@ extern void pq_sendtext(StringInfo buf, const char *str, int slen); ...@@ -24,6 +24,8 @@ extern void pq_sendtext(StringInfo buf, const char *str, int slen);
extern void pq_sendstring(StringInfo buf, const char *str); extern void pq_sendstring(StringInfo buf, const char *str);
extern void pq_sendint(StringInfo buf, int i, int b); extern void pq_sendint(StringInfo buf, int i, int b);
extern void pq_sendint64(StringInfo buf, int64 i); extern void pq_sendint64(StringInfo buf, int64 i);
extern void pq_sendfloat4(StringInfo buf, float4 f);
extern void pq_sendfloat8(StringInfo buf, float8 f);
extern void pq_endmessage(StringInfo buf); extern void pq_endmessage(StringInfo buf);
extern void pq_begintypsend(StringInfo buf); extern void pq_begintypsend(StringInfo buf);
...@@ -35,6 +37,8 @@ extern void pq_putemptymessage(char msgtype); ...@@ -35,6 +37,8 @@ extern void pq_putemptymessage(char msgtype);
extern int pq_getmsgbyte(StringInfo msg); extern int pq_getmsgbyte(StringInfo msg);
extern unsigned int pq_getmsgint(StringInfo msg, int b); extern unsigned int pq_getmsgint(StringInfo msg, int b);
extern int64 pq_getmsgint64(StringInfo msg); extern int64 pq_getmsgint64(StringInfo msg);
extern float4 pq_getmsgfloat4(StringInfo msg);
extern float8 pq_getmsgfloat8(StringInfo msg);
extern const char *pq_getmsgbytes(StringInfo msg, int datalen); extern const char *pq_getmsgbytes(StringInfo msg, int datalen);
extern void pq_copymsgbytes(StringInfo msg, char *buf, int datalen); extern void pq_copymsgbytes(StringInfo msg, char *buf, int datalen);
extern char *pq_getmsgtext(StringInfo msg, int rawbytes, int *nbytes); extern char *pq_getmsgtext(StringInfo msg, int rawbytes, int *nbytes);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: builtins.h,v 1.213 2003/05/09 15:44:42 tgl Exp $ * $Id: builtins.h,v 1.214 2003/05/09 21:19:50 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -181,6 +181,8 @@ extern Datum int2shr(PG_FUNCTION_ARGS); ...@@ -181,6 +181,8 @@ extern Datum int2shr(PG_FUNCTION_ARGS);
/* name.c */ /* name.c */
extern Datum namein(PG_FUNCTION_ARGS); extern Datum namein(PG_FUNCTION_ARGS);
extern Datum nameout(PG_FUNCTION_ARGS); extern Datum nameout(PG_FUNCTION_ARGS);
extern Datum namerecv(PG_FUNCTION_ARGS);
extern Datum namesend(PG_FUNCTION_ARGS);
extern Datum nameeq(PG_FUNCTION_ARGS); extern Datum nameeq(PG_FUNCTION_ARGS);
extern Datum namene(PG_FUNCTION_ARGS); extern Datum namene(PG_FUNCTION_ARGS);
extern Datum namelt(PG_FUNCTION_ARGS); extern Datum namelt(PG_FUNCTION_ARGS);
...@@ -222,8 +224,12 @@ extern int extra_float_digits; ...@@ -222,8 +224,12 @@ extern int extra_float_digits;
extern Datum float4in(PG_FUNCTION_ARGS); extern Datum float4in(PG_FUNCTION_ARGS);
extern Datum float4out(PG_FUNCTION_ARGS); extern Datum float4out(PG_FUNCTION_ARGS);
extern Datum float4recv(PG_FUNCTION_ARGS);
extern Datum float4send(PG_FUNCTION_ARGS);
extern Datum float8in(PG_FUNCTION_ARGS); extern Datum float8in(PG_FUNCTION_ARGS);
extern Datum float8out(PG_FUNCTION_ARGS); extern Datum float8out(PG_FUNCTION_ARGS);
extern Datum float8recv(PG_FUNCTION_ARGS);
extern Datum float8send(PG_FUNCTION_ARGS);
extern Datum float4abs(PG_FUNCTION_ARGS); extern Datum float4abs(PG_FUNCTION_ARGS);
extern Datum float4um(PG_FUNCTION_ARGS); extern Datum float4um(PG_FUNCTION_ARGS);
extern Datum float4up(PG_FUNCTION_ARGS); extern Datum float4up(PG_FUNCTION_ARGS);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: geo_decls.h,v 1.38 2002/06/20 20:29:52 momjian Exp $ * $Id: geo_decls.h,v 1.39 2003/05/09 21:19:50 tgl Exp $
* *
* NOTE * NOTE
* These routines do *not* use the float types from adt/. * These routines do *not* use the float types from adt/.
...@@ -188,6 +188,8 @@ typedef struct ...@@ -188,6 +188,8 @@ typedef struct
/* public point routines */ /* public point routines */
extern Datum point_in(PG_FUNCTION_ARGS); extern Datum point_in(PG_FUNCTION_ARGS);
extern Datum point_out(PG_FUNCTION_ARGS); extern Datum point_out(PG_FUNCTION_ARGS);
extern Datum point_recv(PG_FUNCTION_ARGS);
extern Datum point_send(PG_FUNCTION_ARGS);
extern Datum construct_point(PG_FUNCTION_ARGS); extern Datum construct_point(PG_FUNCTION_ARGS);
extern Datum point_left(PG_FUNCTION_ARGS); extern Datum point_left(PG_FUNCTION_ARGS);
extern Datum point_right(PG_FUNCTION_ARGS); extern Datum point_right(PG_FUNCTION_ARGS);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment