Function parameters change when update to 8.3

Started by tuanhoanganhabout 18 years ago5 messagesgeneral
Jump to latest
#1tuanhoanganh
hatuan05@gmail.com

I have function in PostgreSQL 8.2
CREATE OR REPLACE FUNCTION post_ctpxd(ud_stt_rec)
RETURNS void AS
$BODY$DECLARE
...
BEGIN
....
END
$BODY$
LANGUAGE 'plpgsql' VOLATILE;

My domain in 8.2
CREATE DOMAIN ud_stt_rec
AS character(20)
DEFAULT ''::bpchar
NOT NULL;

But when I dump database and restore to 8.3 this function change to

CREATE OR REPLACE FUNCTION post_ctpt1(ud_stt_rec(24))
RETURNS void AS
$BODY$DECLARE
...
BEGIN
...
END
$BODY$
LANGUAGE 'plpgsql' VOLATILE
COST 100;

My domain in 8.3
CREATE DOMAIN ud_stt_rec
AS character(20)
DEFAULT ''::bpchar;

So when I run script CREATE OR REPLACE FUNCTION post_ctpt1
it have error

ERROR: type modifier is not allowed for type "ud_stt_rec"

********** Error **********

ERROR: type modifier is not allowed for type "ud_stt_rec"
SQL state: 42601

Please help me. Thank you very much.

Tuan Hoang Anh
hatuan05@gmail.com

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: tuanhoanganh (#1)
Re: Function parameters change when update to 8.3

tuanhoanganh <hatuan05@gmail.com> writes:

... But when I dump database and restore to 8.3 this function change to

CREATE OR REPLACE FUNCTION post_ctpt1(ud_stt_rec(24))

It works as expected for me. Please provide a *complete* test case,
including the specific dump and reload procedures you are using.

regards, tom lane

#3tuanhoanganh
hatuan05@gmail.com
In reply to: Tom Lane (#2)
Re: Function parameters change when update to 8.3

On 2/22/08, Tom Lane <tgl@sss.pgh.pa.us> wrote:

tuanhoanganh <hatuan05@gmail.com> writes:

... But when I dump database and restore to 8.3 this function change to

CREATE OR REPLACE FUNCTION post_ctpt1(ud_stt_rec(24))

It works as expected for me. Please provide a *complete* test case,
including the specific dump and reload procedures you are using.

regards, tom lane

My ud_stt_rec domain
CREATE DOMAIN ud_stt_rec
AS character(20)
DEFAULT ''::bpchar;
ALTER DOMAIN ud_stt_rec OWNER TO postgres;

I write script in Query of pgAdminIII
CREATE OR REPLACE FUNCTION test(ud_stt_rec)
RETURNS void AS
$BODY$
BEGIN
RETURN;
END
$BODY$
LANGUAGE 'plpgsql' VOLATILE;
ALTER FUNCTION test(ud_stt_rec) OWNER TO postgres;

This script run well.
In functions, I have a new function test. But when I choose "CREATE
script" with function test the script change to

-- Function: test(ud_stt_rec(24))

-- DROP FUNCTION test(ud_stt_rec(24));

CREATE OR REPLACE FUNCTION test(ud_stt_rec(24))
RETURNS void AS
$BODY$
BEGIN
RETURN;
END
$BODY$
LANGUAGE 'plpgsql' VOLATILE
COST 100;
ALTER FUNCTION test(ud_stt_rec(24)) OWNER TO postgres;

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: tuanhoanganh (#3)
Re: Function parameters change when update to 8.3

tuanhoanganh <hatuan05@gmail.com> writes:

I write script in Query of pgAdminIII
...
In functions, I have a new function test. But when I choose "CREATE
script" with function test the script change to

-- Function: test(ud_stt_rec(24))

-- DROP FUNCTION test(ud_stt_rec(24));

CREATE OR REPLACE FUNCTION test(ud_stt_rec(24))

I'd say this is a pgadmin bug, which you should report on the pgadmin
mailing lists. But first, are you using the latest version of pgadmin?

regards, tom lane

#5tuanhoanganh
hatuan05@gmail.com
In reply to: Tom Lane (#4)
Re: Function parameters change when update to 8.3

Thank you, I use pgAdmin 1.8.2

On Fri, Feb 22, 2008 at 10:24 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Show quoted text

tuanhoanganh <hatuan05@gmail.com> writes:

I write script in Query of pgAdminIII
...
In functions, I have a new function test. But when I choose "CREATE
script" with function test the script change to

-- Function: test(ud_stt_rec(24))

-- DROP FUNCTION test(ud_stt_rec(24));

CREATE OR REPLACE FUNCTION test(ud_stt_rec(24))

I'd say this is a pgadmin bug, which you should report on the pgadmin
mailing lists. But first, are you using the latest version of pgadmin?

regards, tom lane