Author Topic: google_contacts PLugin DB Error  (Read 7213 times)

Offline futurecis

  • Jr. Member
  • **
  • Posts: 22
    • http://www.futurecis.com
google_contacts PLugin DB Error
« on: April 13, 2010, 12:30:24 PM »
I am getting the following error message from the google_contacts plugin. This is from the RC errors log. I thought it was due to permissions on the DB but the table has the same perms as everything else.


[13-Apr-2010 12:20:50] MDB2 Error: insufficient permissions (-27): _doQuery: [Error message: Could not execute statement]
[Last executed query: INSERT INTO google_contacts
         (user_id, changed, del, "name", "email", "firstname", "surname", "vcard")
         VALUES (1, now(), 0, 'John Smith (jsmith@example.com)', 'jsmith@example.com', 'John', 'Smith', '')]
[Native message: ERROR:  permission denied for sequence collected_contact_ids]



Can anyone help?

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
google_contacts PLugin DB Error
« Reply #1 on: April 13, 2010, 02:34:20 PM »
Could you please the SQL script you have used to create the table?
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline futurecis

  • Jr. Member
  • **
  • Posts: 22
    • http://www.futurecis.com
google_contacts PLugin DB Error
« Reply #2 on: April 13, 2010, 02:47:52 PM »
Yes, I used the one that came with the plugin for Postgres

--
-- Sequence "collected_contact_ids"
-- Name: collected_contact_ids; Type: SEQUENCE; Schema: public; Owner: roundcube
--

CREATE SEQUENCE collected_contact_ids
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;

--
-- Table "google_contacts"
-- Name: google_contacts; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE google_contacts (
    contact_id integer DEFAULT nextval('collected_contact_ids'::text) PRIMARY KEY,
    user_id integer NOT NULL REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE CASCADE,
    changed timestamp with time zone DEFAULT now() NOT NULL,
    del smallint DEFAULT 0 NOT NULL,
    name character varying(128) DEFAULT ''::character varying NOT NULL,
    email character varying(128) DEFAULT ''::character varying NOT NULL,
    firstname character varying(128) DEFAULT ''::character varying NOT NULL,
    surname character varying(128) DEFAULT ''::character varying NOT NULL,
    vcard text
);

CREATE INDEX google_contacts_user_id_idx ON google_contacts (user_id);

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
google_contacts PLugin DB Error
« Reply #3 on: April 13, 2010, 02:57:18 PM »
I'm not familiar with PostGres but it looks like the original script is from automated_addressbook and the contributor forgot to replace 'collected_contacts' by 'google_contacts'.
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline futurecis

  • Jr. Member
  • **
  • Posts: 22
    • http://www.futurecis.com
google_contacts PLugin DB Error
« Reply #4 on: April 29, 2010, 08:01:26 PM »
Yes, that was the issue. Thank you. I have changed the php file and updated the database table accordingly.