Re: Auto-timestamp generator (attached) - Mailing list pgsql-general

From Joseph Shraibman
Subject Re: Auto-timestamp generator (attached)
Date
Msg-id 3A833FD5.F3CD3696@selectacast.net
Whole thread Raw
In response to Auto-timestamp generator (attached)  ("Richard Huxton" <dev@archonet.com>)
Responses Re: Auto-timestamp generator (attached)
List pgsql-general
Tom Lane wrote:
>
> Joseph Shraibman <jks@selectacast.net> writes:
> >> Yes, that proves that your core backend is 7.0.3.  However, the spelling
> >> of the error message proves that your plpgsql shlib is NOT 7.0.3.  It
> >> might well be 6.5 or even older.
>
> > Huh?  How could that happen?
>
> Easily.  Check the path to the shlib that's defined in the CREATE
> FUNCTION call for plpgsql_call_handler, eg do
>         select * from pg_proc where proname = 'plpgsql_call_handler';
> The backend will believe whatever you tell it --- if, say, you restored
> a 6.5 dump that had a different library path than your current
> installation, you'd be in trouble.  How exactly did you install plpgsql
> support into this database?
>
>                         regards, tom lane
CREATE FUNCTION "plpgsql_call_handler" ( ) RETURNS opaque AS
'/usr/lib/pgsql/plpgsql.so' LANGUAGE 'C';

CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql' HANDLER
"plpgsql_call_handler" LANCOMPILER 'PL/pgSQL';

I just cut and pasted without looking at it.  Stupid me.  That points to
the 6.5.3 lib that came with redhat.

Now:
playpen=# select lastchg_addto('foo','c');
ERROR:  fmgr_info: function 326368: cache lookup failed

There is nothing in  pg_proc with oid of 326368.

But if try again in a newly created database:
playpen2=# CREATE FUNCTION "plpgsql_call_handler" ( ) RETURNS opaque AS
playpen2-# '/usr/local/pgsql/lib/plpgsql.so' LANGUAGE 'C';
CREATE
playpen2=#
playpen2=# CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql' HANDLER
playpen2-# "plpgsql_call_handler" LANCOMPILER 'PL/pgSQL';
CREATE
playpen2=# \i temp.txt
CREATE
CREATE
playpen2=# create table foo (a serial, b text, c timestamp);
NOTICE:  CREATE TABLE will create implicit sequence 'foo_a_seq' for
SERIAL column 'foo.a'
NOTICE:  CREATE TABLE/UNIQUE will create implicit index 'foo_a_key' for
table 'foo'
CREATE
playpen2=#  select lastchg_addto('foo','c');
ERROR:  parser: parse error at or near "execute"


Is there something in the script that is not compatible with 7.0.3?

--
Joseph Shraibman
jks@selectacast.net
Increase signal to noise ratio.  http://www.targabot.com

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Auto-timestamp generator (attached)
Next
From: Tom Lane
Date:
Subject: Re: Auto-timestamp generator (attached)