Re: PostgreSQL-11 partition creation issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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






[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux