adding a function to pg_proc.h

Поиск
Список
Период
Сортировка
От Jaime Casanova
Тема adding a function to pg_proc.h
Дата
Msg-id c2d9e70e05052515482f8744a3@mail.gmail.com
обсуждение исходный текст
Ответы Re: adding a function to pg_proc.h  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 ;)


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: WAL replay failure after file truncation(?)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: adding a function to pg_proc.h