adding a function to pg_proc.h

From: Jaime Casanova <systemguards(at)gmail(dot)com>
To: Hackers <pgsql-hackers(at)postgresql(dot)org>, Bernd Helmle <bernd(dot)helmle(at)oopsware(dot)de>
Subject: adding a function to pg_proc.h
Date: 2005-05-25 22:48:18
Message-ID: c2d9e70e05052515482f8744a3@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I have added a function in sources and added appropiate lines in pg_proc.h

DATA(insert OID = 2560 ( get_view_column_default PGNSP PGUID 12 f f
t f i 1 2283 "25 25 21" _null_ _null_ _null_ get_view_column_default -
_null_));
DESCR("get default value for view column");

then make; make install; and initdb the data directory.

When i start postgres i look for the function using:

\df get_view*

List of functions
Schema | Name | Result data type | Argument data types
------------+-------------------------+------------------+----------------------
pg_catalog | get_view_column_default | anyelement | text, text, smallint
(1 row)

So far, so good... I will do a test

create table foo (
col1 serial,
col2 int2
);
NOTICE: CREATE TABLE will create implicit sequence "foo_col1_seq" for
serial column "foo.col1"

create view v_foo as select * from foo;
NOTICE: CREATE VIEW will create implicit INSERT/UPDATE/DELETE rules

alter table v_foo alter col1 set default
get_view_column_default('public'::text, 'foo'::text, 1::smallint);
ERROR: function get_view_column_default(text, text, smallint) does not exist
HINT: No function matches the given name and argument types. You may
need to add explicit type casts.

So the question is why ERROR message tell the function doesn't exist,
as you can see the function actually exists.
I change the return data type to bigint and got the same error so it
seems is not a problem of returning anyelement.

any comments will be appreciated.

--
regards,
Jaime Casanova
(DBA: DataBase Aniquilator ;)

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-05-25 23:46:07 Re: adding a function to pg_proc.h
Previous Message Tom Lane 2005-05-25 22:19:19 Re: WAL replay failure after file truncation(?)