pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kyle Bateman <kyle@actarg.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: clock command regression in pltcl?
Date: Sat, 23 Jan 2010 01:50:12 -0500
Message-ID: <2072.1264229412@sss.pgh.pa.us> (raw)
In-Reply-To: <1720.1264227988@sss.pgh.pa.us>
References: <4B5A7E04.8030905@actarg.com>
	<1720.1264227988@sss.pgh.pa.us>

I wrote:
> I am not sure if this is a bug or an intentional change on their part.
> Apparently "clock" was completely rewritten in 8.5, with a lot more
> features, which could mean it's not safe anymore.  But I don't see
> any explicit acknowledgement in the release notes that it's now
> considered unsafe.

Oh, this is interesting: tclInterp.c's SlaveCreate() has a special
purpose hack now:

    /*
     * The [clock] command presents a safe API, but uses unsafe features in
     * its implementation. This means it has to be implemented in safe interps
     * as an alias to a version in the (trusted) master.
     */

    if (safe) {
	Tcl_Obj *clockObj;
	int status;

	TclNewLiteralStringObj(clockObj, "clock");
	Tcl_IncrRefCount(clockObj);
	status = AliasCreate(interp, slaveInterp, masterInterp, clockObj,
		clockObj, 0, NULL);
	Tcl_DecrRefCount(clockObj);
	if (status != TCL_OK) {
	    goto error2;
	}
    }

So apparently it's still *supposed* to work, but there's something about
the way we are using tcl that makes it not work.  Any tcl experts in the
house?

			regards, tom lane



view thread (4+ messages)  latest in thread

Message-ID: <2072.1264229412@sss.pgh.pa.us>
Permalink:  ../2072.1264229412@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2072.1264229412@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, kyle@actarg.com
  Subject: Re: clock command regression in pltcl?
  In-Reply-To: <2072.1264229412@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox