? config.log ? dbs ? config.cache ? config.status ? update.pb.sh ? make.pb.sh ? GNUmakefile ? pb.sql ? restart.pb.sh ? src/GNUmakefile ? src/Makefile.global ? src/backend/postgres ? src/backend/catalog/postgres.bki ? src/backend/catalog/postgres.description ? src/backend/parser/pb ? src/backend/port/Makefile ? src/bin/initdb/initdb ? src/bin/initlocation/initlocation ? src/bin/ipcclean/ipcclean ? src/bin/pg_config/pg_config ? src/bin/pg_ctl/pg_ctl ? src/bin/pg_dump/pg_dump ? src/bin/pg_dump/pg_restore ? src/bin/pg_dump/pg_dumpall ? src/bin/pg_id/pg_id ? src/bin/pg_passwd/pg_passwd ? src/bin/psql/psql ? src/bin/scripts/createlang ? src/include/pg_config.h ? src/include/stamp-h ? src/interfaces/ecpg/lib/libecpg.so.3.3.0 ? src/interfaces/ecpg/preproc/ecpg ? src/interfaces/libpgeasy/libpgeasy.so.2.2 ? src/interfaces/libpq/libpq.so.2.2 ? src/pl/plpgsql/src/libplpgsql.so.1.0 Index: src/backend/parser/gram.y =================================================================== RCS file: /projects/cvsroot/pgsql/src/backend/parser/gram.y,v retrieving revision 2.276 diff -r2.276 gram.y 198c198 < expr_list, attrs, target_list, update_target_list, --- > expr_list, attrs, target_list, insert_target_list, update_target_list, 256c256 < %type target_el, update_target_el --- > %type target_el, update_target_el, insert_target_el 3305c3305 < insert_rest: VALUES '(' target_list ')' --- > insert_rest: VALUES '(' insert_target_list ')' 5485c5485 < /* Target lists as found in SELECT ... and INSERT VALUES ( ... ) */ --- > /* Target lists as found in SELECT ... */ 5492a5493,5517 > /* Target lists as found in INSERT VALUES ( ... ) */ > > /* pavlo (pb@pbit.org): 2001-12-27: parse node based handling for the DEFAULT value added; > now it's possible to INSERT INTO ... VALUES (..., FEFAULT, ...)! > */ > insert_target_list: insert_target_list ',' insert_target_el > { $$ = lappend($1, $3); } > | insert_target_el > { $$ = makeList1($1); } > | insert_target_list ',' target_el > { $$ = lappend($1, $3); } > | target_el > { $$ = makeList1($1); } > ; > > insert_target_el: DEFAULT > { > Default *n = makeNode(Default); > $$ = makeNode(ResTarget); > $$->name = NULL; > $$->indirection = NULL; > $$->val = (Node *)n; > } > ; > 5493a5519 > 6383c6409 < } --- > } \ No newline at end of file Index: src/backend/parser/parse_coerce.c =================================================================== RCS file: /projects/cvsroot/pgsql/src/backend/parser/parse_coerce.c,v retrieving revision 2.64 diff -r2.64 parse_coerce.c 39c39 < Node *result; --- > Node *result; 69d68 < 75d73 < 79,80c77,78 < char *val = DatumGetCString(DirectFunctionCall1(textout, < con->constvalue)); --- > char *val = DatumGetCString(DirectFunctionCall1(textout, con->constvalue)); > newcon->constvalue = stringTypeDatum(targetType, val, atttypmod); 82d79 < newcon->constvalue = stringTypeDatum(targetType, val, atttypmod); 607c604 < } /* PreferredType() */ --- > } /* PreferredType() */ \ No newline at end of file Index: src/backend/parser/parse_expr.c =================================================================== RCS file: /projects/cvsroot/pgsql/src/backend/parser/parse_expr.c,v retrieving revision 1.105 diff -r1.105 parse_expr.c 123a124,128 > case T_Default: /* pavlo (pb@pbit.org): 2001-12-27: transormation for the DEFAULT value for INSERT INTO foo VALUES (..., DEFAULT, ...)*/ > { > result = (Default *) expr; > break; > } 1069c1074 < } --- > } \ No newline at end of file Index: src/backend/parser/parse_target.c =================================================================== RCS file: /projects/cvsroot/pgsql/src/backend/parser/parse_target.c,v retrieving revision 1.76 diff -r1.76 parse_target.c 62a63,74 > /* pavlo (pb@pbit.org: 2001-12-27: handle the DEFAULT in INSERT INTO foo VALUES (..., DEFAULT, ...))*/ > if (IsA(expr, Default)) > { > if (pstate->p_target_relation->rd_att->attrs[(AttrNumber) pstate->p_last_resno - 1]->atthasdef) > { > Const *con = (Const *) stringToNode(pstate->p_target_relation->rd_att->constr->defval[(AttrNumber) pstate->p_last_resno - 1].adbin); > expr = con; > } > else > elog(ERROR, "no default value for column \"%s\" found\nDEFAULT cannot be inserted", colname); > } > 263c275 < if (tle->expr == NULL) --- > if (tle->expr == NULL) 302c314 < expr = coerce_type(pstate, expr, type_id, attrtype, attrtypmod); --- > expr = coerce_type(pstate, expr, type_id, attrtype, attrtypmod); 528c540 < } --- > } \ No newline at end of file Index: src/backend/parser/scan.l =================================================================== RCS file: /projects/cvsroot/pgsql/src/backend/parser/scan.l,v retrieving revision 1.90 diff -r1.90 scan.l 640c640 < #endif /* FLEX_SCANNER */ --- > #endif /* FLEX_SCANNER */ \ No newline at end of file Index: src/include/nodes/nodes.h =================================================================== RCS file: /projects/cvsroot/pgsql/src/include/nodes/nodes.h,v retrieving revision 1.96 diff -r1.96 nodes.h 224a225 > T_Default, /* pavlo (pb@pbit.org) : 2001.12.27: DEFAULT element of the INSERT INTO target list*/ 368c369 < #endif /* NODES_H */ --- > #endif /* NODES_H */ \ No newline at end of file Index: src/include/nodes/parsenodes.h =================================================================== RCS file: /projects/cvsroot/pgsql/src/include/nodes/parsenodes.h,v retrieving revision 1.151 diff -r1.151 parsenodes.h 1007a1008,1016 > * pavlo (pb@pbit.org): 2001.12.27: > * Default - the DEFAULT constant expression used in the target list of INSERT INTO ... VALUES (..., DEFAULT, ...) > */ > typedef struct Default > { > NodeTag type; > } Default; > > /* 1358c1367 < #endif /* PARSENODES_H */ --- > #endif /* PARSENODES_H */ \ No newline at end of file