|
10 | 10 | * Written by Peter Eisentraut <peter_e@gmx.net>.
|
11 | 11 | *
|
12 | 12 | * IDENTIFICATION
|
13 |
| - * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.315 2006/04/10 21:53:38 tgl Exp $ |
| 13 | + * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.316 2006/04/25 14:09:15 momjian Exp $ |
14 | 14 | *
|
15 | 15 | *--------------------------------------------------------------------
|
16 | 16 | */
|
|
32 | 32 | #include"catalog/namespace.h"
|
33 | 33 | #include"catalog/pg_type.h"
|
34 | 34 | #include"commands/async.h"
|
| 35 | +#include"commands/prepare.h" |
35 | 36 | #include"commands/variable.h"
|
36 | 37 | #include"commands/vacuum.h"
|
37 | 38 | #include"executor/executor.h"
|
|
53 | 54 | #include"postmaster/bgwriter.h"
|
54 | 55 | #include"postmaster/syslogger.h"
|
55 | 56 | #include"postmaster/postmaster.h"
|
| 57 | +#include"storage/backendid.h" |
56 | 58 | #include"storage/bufmgr.h"
|
57 | 59 | #include"storage/fd.h"
|
58 | 60 | #include"storage/freespace.h"
|
|
61 | 63 | #include"tcop/tcopprot.h"
|
62 | 64 | #include"utils/array.h"
|
63 | 65 | #include"utils/builtins.h"
|
| 66 | +#include"utils/hsearch.h" |
64 | 67 | #include"utils/memutils.h"
|
65 | 68 | #include"utils/pg_locale.h"
|
| 69 | +#include"utils/portal.h" |
| 70 | +#include"utils/syscache.h" |
66 | 71 | #include"pgstat.h"
|
67 | 72 |
|
68 |
| - |
69 | 73 | #ifndefPG_KRB_SRVTAB
|
70 | 74 | #definePG_KRB_SRVTAB ""
|
71 | 75 | #endif
|
@@ -4649,8 +4653,33 @@ GetPGVariableResultDesc(const char *name)
|
4649 | 4653 | void
|
4650 | 4654 | ResetPGVariable(constchar*name)
|
4651 | 4655 | {
|
| 4656 | +charnamespaceName[NAMEDATALEN]; |
| 4657 | +OidnamespaceId; |
| 4658 | + |
4652 | 4659 | if (pg_strcasecmp(name,"all")==0)
|
| 4660 | +/* resetting all GUC variables */ |
4653 | 4661 | ResetAllOptions();
|
| 4662 | +elseif(pg_strcasecmp(name,"connection")==0) |
| 4663 | +{ |
| 4664 | +ResetAllOptions(); |
| 4665 | + |
| 4666 | +/* Clean temp-tables */ |
| 4667 | +snprintf(namespaceName,sizeof(namespaceName),"pg_temp_%d", |
| 4668 | +MyBackendId); |
| 4669 | +namespaceId=GetSysCacheOid(NAMESPACENAME, |
| 4670 | +CStringGetDatum(namespaceName),0,0,0); |
| 4671 | +RemoveTempRelations(namespaceId); |
| 4672 | + |
| 4673 | +DropAllPreparedStatements(); |
| 4674 | + |
| 4675 | +Async_UnlistenAll(); |
| 4676 | + |
| 4677 | +/* Delete cursors, including WITH HOLD */ |
| 4678 | +PortalHashTableDeleteAll(); |
| 4679 | + |
| 4680 | +if (IsTransactionBlock()) |
| 4681 | +UserAbortTransactionBlock(); |
| 4682 | +} |
4654 | 4683 | else
|
4655 | 4684 | set_config_option(name,
|
4656 | 4685 | NULL,
|
|