I want to create a timestamp column with a default value of epoch. How can I do it? This, and all the variations I've tried don't work:
...
last_viewed_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT TIMESTAMP "epoch",
...
It's all about double quotes vs single quotes. Double quotes are for identifiers so you want:
...
last_viewed_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT TIMESTAMP 'epoch',
...
fiddle
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With