13
13
< H1 > Developer's Frequently Asked Questions (FAQ) for
14
14
PostgreSQL</ H1 >
15
15
16
- < P > Last updated: Sat May 5 00:09:15 EDT 2007</ P >
16
+ < P > Last updated: Sat May 5 06:20:41 EDT 2007</ P >
17
17
18
18
< P > Current maintainer: Bruce Momjian (< A href =
19
19
"mailto:bruce@momjian.us "> bruce@momjian.us</ A > )< BR >
@@ -863,24 +863,25 @@ <H3 id="item2.3">2.3) Why do we use <I>Node</I> and
863
863
< DL >
864
864
< DT > lfirst(i), lfirst_int(i), lfirst_oid(i)</ DT >
865
865
866
- < DD > return the data (a point , integer and OID respectively) at
867
- list element < I > i.</ I > </ DD >
866
+ < DD > return the data (a pointer , integer or OID respectively) of
867
+ list cell < I > i.</ I > </ DD >
868
868
869
869
< DT > lnext(i)</ DT >
870
870
871
- < DD > return the next list element after < I > i.</ I > </ DD >
871
+ < DD > return the next list cell after < I > i.</ I > </ DD >
872
872
873
873
< DT > foreach(i, list)</ DT >
874
874
875
875
< DD >
876
- loop through < I > list,</ I > assigning each list element to
877
- < I > i.</ I > It is important to note that < I > i</ I > is a List *,
876
+ loop through < I > list,</ I > assigning each list cell to
877
+ < I > i.</ I > It is important to note that < I > i</ I > is a ListCell *,
878
878
not the data in the < I > List</ I > element. You need to use
879
879
< I > lfirst(i)</ I > to get at the data. Here is a typical code
880
880
snippet that loops through a List containing < I > Var *'s</ I >
881
881
and processes each one:
882
882
< PRE >
883
- < CODE > List *list;
883
+ < CODE >
884
+ List *list;
884
885
ListCell *i;
885
886
886
887
foreach(i, list)
@@ -900,26 +901,26 @@ <H3 id="item2.3">2.3) Why do we use <I>Node</I> and
900
901
901
902
< DT > lappend(list, node)</ DT >
902
903
903
- < DD > add < I > node</ I > to the end of < I > list.</ I > This is more
904
- expensive that lcons.</ DD >
904
+ < DD > add < I > node</ I > to the end of < I > list.</ I > </ DD >
905
905
906
- < DT > nconc (list1, list2)</ DT >
906
+ < DT > list_concat (list1, list2)</ DT >
907
907
908
- < DD > Concat < I > list2</ I > on to the end of < I > list1.</ I > </ DD >
908
+ < DD > Concatenate < I > list2</ I > on to the end of < I > list1.</ I > </ DD >
909
909
910
- < DT > length (list)</ DT >
910
+ < DT > list_length (list)</ DT >
911
911
912
912
< DD > return the length of the < I > list.</ I > </ DD >
913
913
914
- < DT > nth(i, list )</ DT >
914
+ < DT > list_nth(list, i )</ DT >
915
915
916
- < DD > return the < I > i</ I > 'th element in < I > list.</ I > </ DD >
916
+ < DD > return the < I > i</ I > 'th element in < I > list,</ I >
917
+ counting from zero.</ DD >
917
918
918
- < DT > lconsi , ...</ DT >
919
+ < DT > lcons_int , ...</ DT >
919
920
920
- < DD > There are integer versions of these: < I > lconsi ,
921
- lappendi </ I > , etc. Also versions for OID lists: < I > lconso ,
922
- lappendo </ I > , etc.</ DD >
921
+ < DD > There are integer versions of these: < I > lcons_int ,
922
+ lappend_int </ I > , etc. Also versions for OID lists: < I > lcons_oid ,
923
+ lappend_oid </ I > , etc.</ DD >
923
924
</ DL >
924
925
</ BLOCKQUOTE >
925
926
You can print nodes easily inside < I > gdb.</ I > First, to disable
@@ -944,7 +945,7 @@ <H3 id="item2.3">2.3) Why do we use <I>Node</I> and
944
945
< H3 id ="item2.4 "> 2.4) I just added a field to a structure.
945
946
What else should I do?</ H3 >
946
947
947
- < P > The structures passing around from the parser, rewrite ,
948
+ < P > The structures passed around in the parser, rewriter ,
948
949
optimizer, and executor require quite a bit of support. Most
949
950
structures have support routines in < I > src/backend/nodes</ I > used
950
951
to create, copy, read, and output those structures (in particular,
0 commit comments