Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1d3a47a

Browse files
committed
Attached patch for unconditional enabling of pltcl-unknown support.
Enabling this feature adds very light overhead of 1 select from pg_class onfirst using of pl/tcl in backend if unknown suppport is really unused.But pl/tcl with this support has very improved functionality.Patch includes changes to documentation.
1 parent36458b9 commit1d3a47a

File tree

6 files changed

+18
-67
lines changed

6 files changed

+18
-67
lines changed

‎configure.in

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -382,22 +382,6 @@ PGAC_ARG_REQ(with, tclconfig, [ --with-tclconfig=DIR tclConfig.sh and tkConf
382382

383383
PGAC_ARG_REQ(with, tkconfig, [ --with-tkconfig=DIR tkConfig.sh is in DIR])
384384

385-
386-
#
387-
# If Tcl is enabled (above) then check for pltcl_unknown_support
388-
#
389-
AC_MSG_CHECKING([whether to build with PL/Tcl unknown support])
390-
if test "$with_tcl" = yes; then
391-
PGAC_ARG_BOOL(enable, pltcl-unknown, no,
392-
[ --enable-pltcl-unknown build PL/Tcl unknown support (if Tcl is enabled)],
393-
[AC_DEFINE([ENABLE_PLTCL_UNKNOWN])])
394-
else
395-
enable_pltcl_unknown=no
396-
fi
397-
AC_MSG_RESULT([$enable_pltcl_unknown])
398-
AC_SUBST([enable_pltcl_unknown])
399-
400-
401385
#
402386
# Optionally build Perl modules (Pg.pm and PL/Perl)
403387
#

‎doc/src/sgml/installation.sgml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/installation.sgml,v 1.61 2001/10/09 22:32:32 petere Exp $ -->
1+
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/installation.sgml,v 1.62 2001/10/13 04:23:50 momjian Exp $ -->
22

33
<chapter id="installation">
44
<title><![%standalone-include[<productname>PostgreSQL</>]]>
@@ -683,15 +683,6 @@ su - postgres
683683
</listitem>
684684
</varlistentry>
685685

686-
<varlistentry>
687-
<term><option>--enable-pltcl-unknown</option></term>
688-
<listitem>
689-
<para>
690-
Enables enables PL/Tcl unknown support.
691-
</para>
692-
</listitem>
693-
</varlistentry>
694-
695686
<varlistentry>
696687
<term><option>--enable-odbc</option></term>
697688
<listitem>

‎doc/src/sgml/pltcl.sgml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/pltcl.sgml,v 2.14 2001/09/1315:55:23 petere Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/pltcl.sgml,v 2.15 2001/10/1304:23:50 momjian Exp $
33
-->
44

55
<chapter id="pltcl">
@@ -513,11 +513,13 @@ CREATE FUNCTION t1_count(int4, int4) RETURNS int4 AS '
513513
</listitem>
514514
</varlistentry>
515515

516-
<varlistentry>
517-
<term>
518-
Modules and the <function>unknown</> command
519-
</term>
520-
<listitem>
516+
517+
</variablelist>
518+
519+
</sect2>
520+
521+
<sect2>
522+
<title> Modules and the <function>unknown</> command</title>
521523
<para>
522524
PL/Tcl has a special support for things often used. It
523525
recognizes two magic tables, <literal>pltcl_modules</> and
@@ -526,20 +528,15 @@ CREATE FUNCTION t1_count(int4, int4) RETURNS int4 AS '
526528
creation. Whenever an unknown Tcl procedure is called, the
527529
unknown proc is asked to check if the procedure is defined in
528530
one of the modules. If this is true, the module is loaded on
529-
demand. To enable this behavior, the
530-
<productname>PostgreSQL</> must be configured with the option
531-
<option>--enable-pltcl-unknown</option>.
531+
demand.
532532
</para>
533533
<para>
534-
There are support scripts to maintain these tables in the modules
535-
subdirectory of the PL/Tcl source including the source for the
536-
unknown module that must get installed initially.
534+
There are support scripts to maintain these tables:
535+
<command>pltcl_loadmod</>,<command>pltcl_listmod</>,
536+
<command>pltcl_delmod</> and source for the
537+
unknown module <filename>share/unknown.pltcl</> that must be loaded
538+
into database initially for getting unknown support.
537539
</para>
538-
</listitem>
539-
</varlistentry>
540-
541-
</variablelist>
542-
543540
</sect2>
544541

545542
</sect1>

‎src/include/pg_config.h.in

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* or in pg_config.h afterwards. Of course, if you edit pg_config.h, then your
99
* changes will be overwritten the next time you run configure.
1010
*
11-
* $Id: pg_config.h.in,v 1.8 2001/10/01 15:33:31 momjian Exp $
11+
* $Id: pg_config.h.in,v 1.9 2001/10/13 04:23:50 momjian Exp $
1212
*/
1313

1414
#ifndefPG_CONFIG_H
@@ -86,9 +86,6 @@
8686
*/
8787
#undef DEF_MAXBACKENDS
8888

89-
/* --enable-pltcl-unknown */
90-
#undef ENABLE_PLTCL_UNKNOWN
91-
9289
/* --enable-nls */
9390
#undef ENABLE_NLS
9491

‎src/pl/tcl/Makefile

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Makefile for the pltcl shared object
44
#
5-
# $Header: /cvsroot/pgsql/src/pl/tcl/Makefile,v 1.34 2001/09/16 16:11:11 petere Exp $
5+
# $Header: /cvsroot/pgsql/src/pl/tcl/Makefile,v 1.35 2001/10/13 04:23:50 momjian Exp $
66
#
77
#-------------------------------------------------------------------------
88

@@ -86,29 +86,21 @@ endif
8686
ifeq ($(TCL_SHARED_BUILD), 1)
8787

8888
all:$(INFILES)
89-
ifeq ($(enable_pltcl_unknown), yes)
9089
$(MAKE) -C modules$@
91-
endif
9290

9391
pltcl$(DLSUFFIX): pltcl.o
9492

9593
install: all installdirs
9694
$(INSTALL_SHLIB)$(DLOBJS)$(DESTDIR)$(pkglibdir)/$(DLOBJS)
97-
ifeq ($(enable_pltcl_unknown), yes)
9895
$(MAKE) -C modules$@
99-
endif
10096

10197
installdirs:
10298
$(mkinstalldirs)$(DESTDIR)$(pkglibdir)
103-
ifeq ($(enable_pltcl_unknown), yes)
10499
$(MAKE) -C modules$@
105-
endif
106100

107101
uninstall:
108102
rm -f$(DESTDIR)$(pkglibdir)/$(DLOBJS)
109-
ifeq ($(enable_pltcl_unknown), yes)
110103
$(MAKE) -C modules$@
111-
endif
112104

113105
else # TCL_SHARED_BUILD = 0
114106

@@ -124,6 +116,4 @@ Makefile.tcldefs: mkMakefile.tcldefs.sh
124116

125117
cleandistcleanmaintainer-clean:
126118
rm -f$(INFILES) pltcl.o Makefile.tcldefs
127-
ifeq ($(enable_pltcl_unknown), yes)
128119
$(MAKE) -C modules$@
129-
endif

‎src/pl/tcl/pltcl.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* ENHANCEMENTS, OR MODIFICATIONS.
3232
*
3333
* IDENTIFICATION
34-
* $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.43 2001/10/0623:21:45 tgl Exp $
34+
* $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.44 2001/10/13 04:23:50 momjian Exp $
3535
*
3636
**********************************************************************/
3737

@@ -146,9 +146,7 @@ static FunctionCallInfo pltcl_current_fcinfo = NULL;
146146
staticvoidpltcl_init_all(void);
147147
staticvoidpltcl_init_interp(Tcl_Interp*interp);
148148

149-
#ifdefENABLE_PLTCL_UNKNOWN
150149
staticvoidpltcl_init_load_unknown(Tcl_Interp*interp);
151-
#endif
152150

153151
Datumpltcl_call_handler(PG_FUNCTION_ARGS);
154152
Datumpltclu_call_handler(PG_FUNCTION_ARGS);
@@ -293,7 +291,6 @@ pltcl_init_interp(Tcl_Interp *interp)
293291
Tcl_CreateCommand(interp,"spi_lastoid",
294292
pltcl_SPI_lastoid,NULL,NULL);
295293

296-
#ifdefENABLE_PLTCL_UNKNOWN
297294
/************************************************************
298295
* Try to load the unknown procedure from pltcl_modules
299296
************************************************************/
@@ -302,12 +299,9 @@ pltcl_init_interp(Tcl_Interp *interp)
302299
pltcl_init_load_unknown(interp);
303300
if (SPI_finish()!=SPI_OK_FINISH)
304301
elog(ERROR,"pltcl_init_interp(): SPI_finish failed");
305-
#endif/* ENABLE_PLTCL_UNKNOWN */
306302
}
307303

308304

309-
#ifdefENABLE_PLTCL_UNKNOWN
310-
311305
/**********************************************************************
312306
* pltcl_init_load_unknown()- Load the unknown procedure from
313307
* table pltcl_modules (if it exists)
@@ -380,8 +374,6 @@ pltcl_init_load_unknown(Tcl_Interp *interp)
380374
Tcl_DStringFree(&unknown_src);
381375
}
382376

383-
#endif/* ENABLE_PLTCL_UNKNOWN */
384-
385377

386378
/**********************************************************************
387379
* pltcl_call_handler- This is the only visible function

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp