Format for Grants to Roles

From: "Roberts, Jon" <Jon(dot)Roberts(at)asurion(dot)com>
To: "pgadmin-hackers" <pgadmin-hackers(at)postgresql(dot)org>
Subject: Format for Grants to Roles
Date: 2008-05-01 14:18:52
Message-ID: 1A6E6D554222284AB25ABE3229A92762E9A2A3@nrtexcus702.int.asurion.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

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

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dave Page 2008-05-01 14:30:57 Re: New problem with the latest Kubuntu
Previous Message Guillaume Lelarge 2008-05-01 13:21:43 Re: New problem with the latest Kubuntu