[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Upgrade error



Not sure what causes that session issue.  Chris M?  At any rate you
should be able to get rid of it by closing all web browser windows and
starting again.

The other issue (permission denied) happens when the table is created
by Postgres (or another user) and not by the one you are loggin in as.

This table holds information about custom fields which have been added
to existing objects.  You can probably safely give select privilege to
everyone.  However, it is not safe to give other priveleleges if you
are concerned about security.

GRANT SELECT ON TABLE custom_table_catalog TO PUBLIC;
GRANT SELECT ON TABLE custom_field_catalog TO PUBLIC;

Best Wishes,
Chris Travers.

On 11/11/06, G. Net <..hidden..> wrote:
> Here is what we can do to make this minimally operational:
>
> go into the sql/Pg-upgrade-2.6.18-2.6.19.sql file and copy everything
> below the rules which add the items into transactions (i.e. the
> custom_table_catalog definition and the like).
>
> Basically run every command other than those create rules and insert
> commands.  Then make sure that the line in Form.pm whcih sets
> {dbversion} i set to 2.6.19.


you mean the stuff copied below? maybe my mistake but if not, it didnt seem to work:
DBD::Pg::st execute failed: ERROR:  permission denied for relation custom_table_catalog
DBD::Pg::st fetchrow_hashref failed: no statement executing
DBD::Pg::st execute failed: ERROR:  value "7044657128191375885" is out of range for type integer
Error! Looking for session:
ERROR:  value "7044657128191375885" is out of range for type integer
------

CREATE TABLE custom_table_catalog (
table_id SERIAL PRIMARY KEY,
extends TEXT,
table_name TEXT
);

CREATE TABLE custom_field_catalog (
field_id SERIAL PRIMARY KEY,
table_id INT REFERENCES custom_table_catalog,
field_name TEXT
);
CREATE OR REPLACE FUNCTION add_custom_field (VARCHAR, VARCHAR, VARCHAR)
RETURNS BOOL AS
'
DECLARE
table_name ALIAS FOR $1;
new_field_name ALIAS FOR $2;
field_datatype ALIAS FOR $3;

BEGIN
    EXECUTE ''SELECT TABLE_ID FROM custom_table_catalog
        WHERE extends = '''''' || table_name || '''''' '';
    IF NOT FOUND THEN
        BEGIN
            INSERT INTO custom_table_catalog (extends) VALUES (table_name);
            EXECUTE ''CREATE TABLE custom_''||table_name ||
                '' (row_id INT)'';
        EXCEPTION WHEN duplicate_table THEN
            -- do nothing
        END;
    END IF;
    EXECUTE ''INSERT INTO custom_field_catalog (field_name, table_id)
    VALUES ( '''''' || new_field_name ||'''''', (SELECT table_id FROM custom_table_catalog
        WHERE extends = ''''''|| table_name || ''''''))'';
    EXECUTE ''ALTER TABLE custom_''||table_name || '' ADD COLUMN ''
        || new_field_name || '' '' || field_datatype;
    RETURN TRUE;
END;
' LANGUAGE PLPGSQL;
-- end function

CREATE OR REPLACE FUNCTION drop_custom_field (VARCHAR, VARCHAR)
RETURNS BOOL AS
'
DECLARE
table_name ALIAS FOR $1;
custom_field_name ALIAS FOR $2;
BEGIN
    DELETE FROM custom_field_catalog
    WHERE field_name = custom_field_name AND
        table_id = (SELECT table_id FROM custom_table_catalog
            WHERE extends = table_name);
    EXECUTE ''ALTER TABLE custom_'' || table_name ||
        '' DROP COLUMN '' || custom_field_name;
    RETURN TRUE;
END;
' LANGUAGE PLPGSQL;
-- end function

UPDATE defaults SET version = '2.6.18';




-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Ledger-smb-users mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-users