Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
edd36688
Commit
edd36688
authored
Feb 13, 1998
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Atttypmod cleanup.
parent
ce88b9b4
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
33 additions
and
32 deletions
+33
-32
src/backend/commands/copy.c
src/backend/commands/copy.c
+2
-3
src/backend/parser/parse_node.c
src/backend/parser/parse_node.c
+8
-8
src/backend/parser/parse_target.c
src/backend/parser/parse_target.c
+2
-2
src/backend/parser/parse_type.c
src/backend/parser/parse_type.c
+5
-5
src/backend/utils/adt/arrayfuncs.c
src/backend/utils/adt/arrayfuncs.c
+8
-7
src/include/catalog/pg_attribute.h
src/include/catalog/pg_attribute.h
+3
-2
src/include/parser/parse_type.h
src/include/parser/parse_type.h
+3
-3
src/include/utils/array.h
src/include/utils/array.h
+2
-2
No files found.
src/backend/commands/copy.c
View file @
edd36688
...
...
@@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.4
1 1998/02/10 16:02:51
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.4
2 1998/02/13 19:45:38
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -48,8 +48,7 @@ static Oid GetOutputFunction(Oid type);
static
Oid
GetTypeElement
(
Oid
type
);
static
Oid
GetInputFunction
(
Oid
type
);
static
Oid
IsTypeByVal
(
Oid
type
);
static
void
GetIndexRelations
(
Oid
main_relation_oid
,
static
void
GetIndexRelations
(
Oid
main_relation_oid
,
int
*
n_indices
,
Relation
**
index_rels
);
...
...
src/backend/parser/parse_node.c
View file @
edd36688
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_node.c,v 1.1
2 1998/02/10 16:03:39
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_node.c,v 1.1
3 1998/02/13 19:45:43
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -79,7 +79,7 @@ make_operand(char *opname,
Assert
(
nodeTag
(
result
)
==
T_Const
);
val
=
(
Datum
)
textout
((
struct
varlena
*
)
con
->
constvalue
);
infunc
=
typeid
Reti
nfunc
(
true_typeId
);
infunc
=
typeid
I
nfunc
(
true_typeId
);
con
=
makeNode
(
Const
);
con
->
consttype
=
true_typeId
;
con
->
constlen
=
typeLen
(
true_type
);
...
...
@@ -185,10 +185,10 @@ make_op(char *opname, Node *ltree, Node *rtree)
CONVERTABLE_TYPE
(
rtypeId
)
&&
nodeTag
(
rtree
)
==
T_Const
&&
!
((
Const
*
)
rtree
)
->
constiscast
)
{
outfunc
=
typeid
Reto
utfunc
(
rtypeId
);
infunc
=
typeid
Reti
nfunc
(
ltypeId
);
outfunc
=
typeid
O
utfunc
(
rtypeId
);
infunc
=
typeid
I
nfunc
(
ltypeId
);
outstr
=
(
char
*
)
fmgr
(
outfunc
,
((
Const
*
)
rtree
)
->
constvalue
);
((
Const
*
)
rtree
)
->
constvalue
=
(
Datum
)
fmgr
(
infunc
,
outstr
);
((
Const
*
)
rtree
)
->
constvalue
=
(
Datum
)
fmgr
(
infunc
,
outstr
,
-
1
);
pfree
(
outstr
);
((
Const
*
)
rtree
)
->
consttype
=
rtypeId
=
ltypeId
;
newtype
=
typeidType
(
rtypeId
);
...
...
@@ -200,10 +200,10 @@ make_op(char *opname, Node *ltree, Node *rtree)
CONVERTABLE_TYPE
(
ltypeId
)
&&
nodeTag
(
ltree
)
==
T_Const
&&
!
((
Const
*
)
ltree
)
->
constiscast
)
{
outfunc
=
typeid
Reto
utfunc
(
ltypeId
);
infunc
=
typeid
Reti
nfunc
(
rtypeId
);
outfunc
=
typeid
O
utfunc
(
ltypeId
);
infunc
=
typeid
I
nfunc
(
rtypeId
);
outstr
=
(
char
*
)
fmgr
(
outfunc
,
((
Const
*
)
ltree
)
->
constvalue
);
((
Const
*
)
ltree
)
->
constvalue
=
(
Datum
)
fmgr
(
infunc
,
outstr
);
((
Const
*
)
ltree
)
->
constvalue
=
(
Datum
)
fmgr
(
infunc
,
outstr
,
-
1
);
pfree
(
outstr
);
((
Const
*
)
ltree
)
->
consttype
=
ltypeId
=
rtypeId
;
newtype
=
typeidType
(
ltypeId
);
...
...
src/backend/parser/parse_target.c
View file @
edd36688
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.
9 1998/02/10 16:03:41
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.
10 1998/02/13 19:45:44
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -394,7 +394,7 @@ make_targetlist_expr(ParseState *pstate,
lnext(expr) =
makeConst(attrtype,
attrlen,
(Datum) fmgr(typeid
Reti
nfunc(attrtype),
(Datum) fmgr(typeid
I
nfunc(attrtype),
val, typeidTypElem(attrtype), -1),
false,
true /* Maybe correct-- 80% chance */ ,
...
...
src/backend/parser/parse_type.c
View file @
edd36688
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_type.c,v 1.
5 1998/02/10 16:03:42
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_type.c,v 1.
6 1998/02/13 19:45:45
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -148,7 +148,7 @@ stringTypeString(Type tp, char *string, int16 atttypmod)
/* Given a type id, returns the out-conversion function of the type */
Oid
typeid
Reto
utfunc
(
Oid
type_id
)
typeid
O
utfunc
(
Oid
type_id
)
{
HeapTuple
typeTuple
;
TypeTupleForm
type
;
...
...
@@ -158,7 +158,7 @@ typeidRetoutfunc(Oid type_id)
ObjectIdGetDatum
(
type_id
),
0
,
0
,
0
);
if
(
!
HeapTupleIsValid
(
typeTuple
))
elog
(
ERROR
,
"typeid
Reto
utfunc: Invalid type - oid = %u"
,
type_id
);
elog
(
ERROR
,
"typeid
O
utfunc: Invalid type - oid = %u"
,
type_id
);
type
=
(
TypeTupleForm
)
GETSTRUCT
(
typeTuple
);
outfunc
=
type
->
typoutput
;
...
...
@@ -241,7 +241,7 @@ GetArrayElementType(Oid typearray)
/* Given a type id, returns the in-conversion function of the type */
Oid
typeid
Reti
nfunc
(
Oid
type_id
)
typeid
I
nfunc
(
Oid
type_id
)
{
HeapTuple
typeTuple
;
TypeTupleForm
type
;
...
...
@@ -251,7 +251,7 @@ typeidRetinfunc(Oid type_id)
ObjectIdGetDatum
(
type_id
),
0
,
0
,
0
);
if
(
!
HeapTupleIsValid
(
typeTuple
))
elog
(
ERROR
,
"typeid
Reti
nfunc: Invalid type - oid = %u"
,
type_id
);
elog
(
ERROR
,
"typeid
I
nfunc: Invalid type - oid = %u"
,
type_id
);
type
=
(
TypeTupleForm
)
GETSTRUCT
(
typeTuple
);
infunc
=
type
->
typinput
;
...
...
src/backend/utils/adt/arrayfuncs.c
View file @
edd36688
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.2
4 1998/01/15 19:45:01 pgsql
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.2
5 1998/02/13 19:45:53 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -43,11 +43,10 @@
/*-=-=--=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-*/
static
int
_ArrayCount
(
char
*
str
,
int
dim
[],
int
typdelim
);
static
char
*
_ReadArrayStr
(
char
*
arrayStr
,
int
nitems
,
int
ndim
,
int
dim
[],
static
char
*
_ReadArrayStr
(
char
*
arrayStr
,
int
nitems
,
int
ndim
,
int
dim
[],
FmgrInfo
*
inputproc
,
Oid
typelem
,
char
typdelim
,
int
typlen
,
bool
typbyval
,
char
typalign
,
int
*
nbytes
);
int
*
nbytes
,
int16
typmod
);
#ifdef LOARRAY
static
char
*
...
...
@@ -93,7 +92,8 @@ static char *array_seek(char *ptr, int eltsize, int nitems);
*/
char
*
array_in
(
char
*
string
,
/* input array in external form */
Oid
element_type
)
/* type OID of an array element */
Oid
element_type
,
/* type OID of an array element */
int16
typmod
)
{
int
typlen
;
bool
typbyval
,
...
...
@@ -208,7 +208,7 @@ array_in(char *string, /* input array in external form */
/* array not a large object */
dataPtr
=
(
char
*
)
_ReadArrayStr
(
p
,
nitems
,
ndim
,
dim
,
&
inputproc
,
typelem
,
typdelim
,
typlen
,
typbyval
,
typalign
,
typ
mod
,
typ
delim
,
typlen
,
typbyval
,
typalign
,
&
nbytes
);
nbytes
+=
ARR_OVERHEAD
(
ndim
);
retval
=
(
ArrayType
*
)
palloc
(
nbytes
);
...
...
@@ -369,6 +369,7 @@ _ReadArrayStr(char *arrayStr,
FmgrInfo
*
inputproc
,
/* function used for the
* conversion */
Oid
typelem
,
int16
typmod
,
char
typdelim
,
int
typlen
,
bool
typbyval
,
...
...
@@ -460,7 +461,7 @@ _ReadArrayStr(char *arrayStr,
*
q
=
'\0'
;
if
(
i
>=
nitems
)
elog
(
ERROR
,
"array_in: illformed array constant"
);
values
[
i
]
=
(
*
fmgr_faddr
(
inputproc
))
(
p
,
typelem
);
values
[
i
]
=
(
*
fmgr_faddr
(
inputproc
))
(
p
,
typelem
,
typmod
);
p
=
++
q
;
if
(
!
eoArray
)
...
...
src/include/catalog/pg_attribute.h
View file @
edd36688
...
...
@@ -7,7 +7,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_attribute.h,v 1.2
7 1998/02/10 16:04:03
momjian Exp $
* $Id: pg_attribute.h,v 1.2
8 1998/02/13 19:46:09
momjian Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
...
...
@@ -88,7 +88,8 @@ CATALOG(pg_attribute) BOOTSTRAP
int2
atttypmod
;
/*
* atttypmod records type-specific modifications supplied at table
* creation time.
* creation time, and passes it to input and output functions as the
* third argument.
*/
bool
attbyval
;
...
...
src/include/parser/parse_type.h
View file @
edd36688
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: parse_type.h,v 1.
4 1998/02/10 16:04:32
momjian Exp $
* $Id: parse_type.h,v 1.
5 1998/02/13 19:46:18
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -27,11 +27,11 @@ extern bool typeByVal(Type t);
extern
char
*
typeTypeName
(
Type
t
);
extern
char
typeTypeFlag
(
Type
t
);
extern
char
*
stringTypeString
(
Type
tp
,
char
*
string
,
int16
atttypmod
);
extern
Oid
typeid
Reto
utfunc
(
Oid
type_id
);
extern
Oid
typeid
O
utfunc
(
Oid
type_id
);
extern
Oid
typeidTypeRelid
(
Oid
type_id
);
extern
Oid
typeTypeRelid
(
Type
typ
);
extern
Oid
typeidTypElem
(
Oid
type_id
);
extern
Oid
GetArrayElementType
(
Oid
typearray
);
extern
Oid
typeid
Reti
nfunc
(
Oid
type_id
);
extern
Oid
typeid
I
nfunc
(
Oid
type_id
);
#endif
/* PARSE_TYPE_H */
src/include/utils/array.h
View file @
edd36688
...
...
@@ -10,7 +10,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: array.h,v 1.
9 1998/01/24 22:50:31
momjian Exp $
* $Id: array.h,v 1.
10 1998/02/13 19:46:22
momjian Exp $
*
* NOTES
* XXX the data array should be LONGALIGN'd -- notice that the array
...
...
@@ -114,7 +114,7 @@ typedef struct
/*
* prototypes for functions defined in arrayfuncs.c
*/
extern
char
*
array_in
(
char
*
string
,
Oid
element_type
);
extern
char
*
array_in
(
char
*
string
,
Oid
element_type
,
int16
typmod
);
extern
char
*
array_out
(
ArrayType
*
v
,
Oid
element_type
);
extern
char
*
array_dims
(
ArrayType
*
v
,
bool
*
isNull
);
extern
Datum
array_ref
(
ArrayType
*
array
,
int
n
,
int
indx
[],
int
reftype
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment