1313< H1 > Developer's Frequently Asked Questions (FAQ) for
1414 PostgreSQL</ H1 >
1515
16- < P > Last updated: Sat May 500:09:15 EDT 2007</ P >
16+ < P > Last updated: Sat May 506:20:41 EDT 2007</ P >
1717
1818< P > Current maintainer: Bruce Momjian (< A href =
1919 "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
863863< DL >
864864< DT > lfirst(i), lfirst_int(i), lfirst_oid(i)</ DT >
865865
866- < DD > return the data (apoint , integerand OID respectively)at
867- listelement < I > i.</ I > </ DD >
866+ < DD > return the data (apointer , integeror OID respectively)of
867+ listcell < I > i.</ I > </ DD >
868868
869869< DT > lnext(i)</ DT >
870870
871- < DD > return the next listelement after< I > i.</ I > </ DD >
871+ < DD > return the next listcell after< I > i.</ I > </ DD >
872872
873873< DT > foreach(i, list)</ DT >
874874
875875< DD >
876- loop through< I > list,</ I > assigning each listelement to
877- < I > i.</ I > It is important to note that< I > i</ I > is aList *,
876+ loop through< I > list,</ I > assigning each listcell to
877+ < I > i.</ I > It is important to note that< I > i</ I > is aListCell *,
878878 not the data in the< I > List</ I > element. You need to use
879879< I > lfirst(i)</ I > to get at the data. Here is a typical code
880880 snippet that loops through a List containing< I > Var *'s</ I >
881881 and processes each one:
882882< PRE >
883- < CODE > List *list;
883+ < CODE >
884+ List *list;
884885 ListCell *i;
885886
886887 foreach(i, list)
@@ -900,26 +901,26 @@ <H3 id="item2.3">2.3) Why do we use <I>Node</I> and
900901
901902< DT > lappend(list, node)</ DT >
902903
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 >
905905
906- < DT > nconc (list1, list2)</ DT >
906+ < DT > list_concat (list1, list2)</ DT >
907907
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 >
909909
910- < DT > length (list)</ DT >
910+ < DT > list_length (list)</ DT >
911911
912912< DD > return the length of the< I > list.</ I > </ DD >
913913
914- < DT > nth(i, list )</ DT >
914+ < DT > list_nth(list, i )</ DT >
915915
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 >
917918
918- < DT > lconsi , ...</ DT >
919+ < DT > lcons_int , ...</ DT >
919920
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 >
923924</ DL >
924925</ BLOCKQUOTE >
925926 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
944945< H3 id ="item2.4 "> 2.4) I just added a field to a structure.
945946 What else should I do?</ H3 >
946947
947- < P > The structurespassing aroundfrom the parser,rewrite ,
948+ < P > The structurespassed aroundin the parser,rewriter ,
948949 optimizer, and executor require quite a bit of support. Most
949950 structures have support routines in< I > src/backend/nodes</ I > used
950951 to create, copy, read, and output those structures (in particular,