Ravi Tammineni <RTammineni@xxxxxxxxxxxxx> writes: > Getting the following error. > ERROR: syntax error at or near "/" > LINE 7: ) partition by to_timestamp(osn_timestamp/1000)::date; You have the syntax wrong, and once you get past that, you'll also find that you're trying to use a non-immutable function in a partition expression (because casting from timestamptz to date depends on the prevailing timezone). Something like this would work, perhaps: =# CREATE TABLE public.oauth_server_nonce_new ( osn_id integer NOT NULL, osn_consumer_key character varying(64) NOT NULL, osn_token character varying(64) NOT NULL, osn_timestamp bigint NOT NULL, osn_nonce character varying(80) NOT NULL ) partition by range (((to_timestamp(osn_timestamp/1000) at time zone 'UTC')::date)); CREATE TABLE regards, tom lane