Jump to:
| Project: | Embed widgets |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
warning: pg_query() [function.pg-query]: Query failed: ERROR: type modifier is not allowed for type "int_unsigned" LINE 4: status int_unsigned(1) NOT NULL default 0, ^ in /Library/WebServer/Documents/drupal/includes/database.pgsql.inc on line 138.
user warning: query: CREATE TABLE embed_widgets ( wid serial CHECK (wid >= 0), uid int_unsigned NOT NULL, status int_unsigned(1) NOT NULL default 0, title varchar(128) NOT NULL default '', description varchar(255) NOT NULL default '', sources text NOT NULL, settings text NOT NULL, footer varchar(128) NOT NULL default '', PRIMARY KEY (wid) ) in /Library/WebServer/Documents/drupal/includes/database.inc on line 514.
warning: pg_query() [function.pg-query]: Query failed: ERROR: type modifier is not allowed for type "int_unsigned" LINE 3: status int_unsigned(1) NOT NULL default 1, ^ in /Library/WebServer/Documents/drupal/includes/database.pgsql.inc on line 138.
user warning: query: CREATE TABLE embed_widgets_sources ( sid serial CHECK (sid >= 0), status int_unsigned(1) NOT NULL default 1, type varchar(35) NOT NULL default '', title varchar(128) NOT NULL default '', description varchar(255) NOT NULL default '', settings text NOT NULL, standalone int_unsigned(1) NOT NULL default 0, PRIMARY KEY (sid) ) in /Library/WebServer/Documents/drupal/includes/database.inc on line 514.
Comments
#1
FWIW, I created the tables for PostGres like so. So far, it's working, but no warranty express or implied ;-)
CREATE TABLE embed_widgets (
wid integer NOT NULL,
uid integer NOT NULL,
status smallint DEFAULT 0 NOT NULL,
title character varying(128) DEFAULT ''::character varying NOT NULL,
description character varying(256) DEFAULT ''::character varying NOT NULL,
sources text DEFAULT ''::text NOT NULL,
settings text NOT NULL,
footer character varying DEFAULT ''::character varying NOT NULL
);
ALTER TABLE public.embed_widgets OWNER TO postgres;
CREATE SEQUENCE embed_widgets_wid_seq
START WITH 1
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
ALTER TABLE public.embed_widgets_wid_seq OWNER TO postgres;
ALTER SEQUENCE embed_widgets_wid_seq OWNED BY embed_widgets.wid;
ALTER TABLE embed_widgets ALTER COLUMN wid SET DEFAULT nextval('embed_widgets_wid_seq'::regclass);
ALTER TABLE ONLY embed_widgets
ADD CONSTRAINT embed_widgets_pkey PRIMARY KEY (wid);
CREATE TABLE embed_widgets_sources (
sid integer NOT NULL,
status smallint DEFAULT 1 NOT NULL,
type character varying(35) DEFAULT ''::character varying NOT NULL,
title character varying(128) DEFAULT ''::character varying NOT NULL,
description character varying(255) DEFAULT ''::character varying NOT NULL,
settings text NOT NULL,
standalone smallint DEFAULT 0
);
ALTER TABLE public.embed_widgets_sources OWNER TO postgres;
CREATE SEQUENCE embed_widgets_sources_sid_seq
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
ALTER TABLE public.embed_widgets_sources_sid_seq OWNER TO postgres;
ALTER SEQUENCE embed_widgets_sources_sid_seq OWNED BY embed_widgets_sources.sid;
ALTER TABLE embed_widgets_sources ALTER COLUMN sid SET DEFAULT nextval('embed_widgets_sources_sid_seq'::regclass);
ALTER TABLE ONLY embed_widgets_sources
ADD CONSTRAINT embed_widgets_sources_pkey PRIMARY KEY (sid);
#2
Thanks for the bug report. If you could test and post a patch, that would be very helpful since I don't have access to a postgres database.
#3
I know PostGres pretty well, but I'm not at all an expert in the database API. For example, I don't understand why a mapping from 'int' to 'integer' isn't handled for me (if that is indeed the right mapping!). If you could educate me a little on this point, I could work this from the API end (though I suppose the *.install program could write SQL directly in the PostGres case, that seems a little iffy).
#4
John, i think a generic fix for unsigned int data type in postgreSQL does not allow type modifier to specify length applies here. So need just comment out a single line in .install file (patch would be an overkill=). What do you think?