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:26:28 -0500
Message-ID: <1720.1264227988@sss.pgh.pa.us> (raw)
In-Reply-To: <4B5A7E04.8030905@actarg.com>
References: <4B5A7E04.8030905@actarg.com>

Kyle Bateman <kyle@actarg.com> writes:
> I have the following function defined:
> create function _date_week(int4,int4,int4) returns text language pltcl 
> immutable as $$
>      return [clock format [clock scan "$2/$3/$1"] -format "%U"]
> $$;

> It worked fine in 8.3 but in 8.4 now I try to build an index using the 
> function and get:

> (empl_id,(date_week(wdate)));: ERROR:  invalid command name "clock"

Are you using the same underlying version of tcl as before?

What I'm seeing is that tcl seems to have dropped "clock" from the set
of commands considered "safe" between tcl 8.4 and 8.5 --- with 8.5
you can only get at it in pltclu.  The version of PG isn't relevant.

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.

			regards, tom lane



view thread (4+ messages)  latest in thread

Message-ID: <1720.1264227988@sss.pgh.pa.us>
Permalink:  ../1720.1264227988@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1720.1264227988@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: <1720.1264227988@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