Our naming standard here is first_name.last_name so my username at work
is jon.roberts. When I look at the DDL script created by pgAdmin, it
doesn't format my name properly for the grants. It does format it
properly for the owner.
Example:
-- Table: jon.part_test
-- DROP TABLE jon.part_test;
CREATE TABLE jon.part_test
(
id integer NOT NULL,
first_name character varying(30) NOT NULL,
last_name character varying(50) NOT NULL,
address_1 character varying(100) NOT NULL,
address_2 character varying(100),
city character varying(50) NOT NULL,
state character varying(2) NOT NULL,
zip character varying(10) NOT NULL,
load_date date NOT NULL,
load_timestamp_with_timezone timestamp with time zone NOT NULL,
load_timestamp_without_timezone timestamp without time zone NOT NULL,
CONSTRAINT part_test_pkey PRIMARY KEY (id)
)
WITH (OIDS=FALSE);
ALTER TABLE jon.part_test OWNER TO "jon.roberts";
GRANT ALL ON TABLE jon.part_test TO "\""jon.roberts\""";
GRANT SELECT ON TABLE jon.part_test TO dev;
This is incorrect:
GRANT ALL ON TABLE jon.part_test TO "\""jon.roberts\""";
This is correct:
GRANT ALL ON TABLE jon.part_test TO "jon.roberts";
Executing this incorrect line fails with this:
ERROR: role "\"jon.roberts\"" does not exist
********** Error **********
ERROR: role "\"jon.roberts\"" does not exist
SQL state: 42704
Jon