Wed Mar 26 23:02:30 PDT 2008
- Previous message: [Slony1-hackers] (no subject)
- Next message: [Slony1-hackers] An useless packet was send by set_config_option()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I send a small patch for CVS-HEAD; The set_config_option function is used in _Slony_I_logTrigger(), I think it shouldn't be used if there is no necessary because a useless packet is returned to the user(frontend). See utiles/misc/guc.c(set_config_option and ReportGUCOption) at PostgreSQL source code. ------ Index: slony1_funcs.c =================================================================== RCS file: /slony1/slony1-engine/src/backend/slony1_funcs.c,v retrieving revision 1.53.2.3 diff -u -r1.53.2.3 slony1_funcs.c --- slony1_funcs.c 22 Nov 2007 22:51:04 -0000 1.53.2.3 +++ slony1_funcs.c 27 Mar 2008 04:50:15 -0000 @@ -575,7 +575,8 @@ */ need_comma = false; OldDateStyle=GetConfigOptionByName("DateStyle", NULL); - set_config_option("DateStyle", "ISO", PGC_USERSET, PGC_S_SESSION, true, true); + if(!strstr(OldDateStyle,"ISO")) + set_config_option("DateStyle", "ISO", PGC_USERSET, PGC_S_SESSION, true, true); for (i = 0; i < tg->tg_relation->rd_att->natts; i++) { /* @@ -615,7 +616,8 @@ cp += len_value; } - set_config_option("DateStyle", OldDateStyle, PGC_USERSET, PGC_S_SESSION, true, true); + if(!strstr(OldDateStyle,"ISO")) + set_config_option("DateStyle", OldDateStyle, PGC_USERSET, PGC_S_SESSION, true, true); /* * Terminate and done @@ -739,9 +741,11 @@ else { OldDateStyle=GetConfigOptionByName("DateStyle", NULL); - set_config_option("DateStyle", "ISO", PGC_USERSET, PGC_S_SESSION, true, true); + if(!strstr(OldDateStyle,"ISO")) + set_config_option("DateStyle", "ISO", PGC_USERSET, PGC_S_SESSION, true, true); col_value = slon_quote_literal(SPI_getvalue(new_row, tupdesc, i + 1)); - set_config_option("DateStyle", OldDateStyle, PGC_USERSET, PGC_S_SESSION, true, true); + if(!strstr(OldDateStyle,"ISO")) + set_config_option("DateStyle", OldDateStyle, PGC_USERSET, PGC_S_SESSION, true, true); } cmddata_need = (cp - (char *)(cs->cmddata_buf)) + 16 + (len_ident = strlen(col_ident)) + ------ -- SRA OSS, Inc. Japan Yoshiharu Mori <y-mori at sraoss.co.jp> http://www.sraoss.co.jp/
- Previous message: [Slony1-hackers] (no subject)
- Next message: [Slony1-hackers] An useless packet was send by set_config_option()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-hackers mailing list