Hello.
Is it possible? I would like to do something like
CREATE OR REPLACE FUNCTION add_column(name, anyelement) RETURNS integer AS '
DECLARE
col_name ALIAS FOR $1;
def_val ALIAS FOR $2;
BEGIN
ALTER TABLE my_table ADD col_name def_val%TYPE;
RETURN 0;
END;
' LANGUAGE plpgsql;
SELECT add_column('a', 1);
Thanks,
--
Alexander Kotelnikov
Saint-Petersburg, Russia