question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

INSERT with interval not support

See original GitHub issue

An insert query

create table test (col timestamp); insert test (col) values (NOW() + interval ‘2 years’)

data: { error: 'cannot cast type interval to timestamp', code: undefined }, location: { start: 0, end: 0 }

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
oguimbalcommented, Oct 28, 2021

Hi,

Too many people had troubles with the lack of support of +/- on interval & date types.

pg-mem is not ready yet to fully support custom operators, but I added to a hack to support this specific use case.

This shipped with with pg-mem@2.1.8. Sorry for the wait, I should have done that much sooner.

0reactions
abadyan-vonagecommented, Oct 28, 2021

Awesome! Thanks for the support on this one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

INTERVAL add i day is not working in postgresql
I have a table like this: CREATE TABLE DateInsert( DateInsert timestamp ...
Read more >
ODBC does not support interval data type - Ask TOM - Oracle
Hi, In Oracle through the ODBC API query a type of data for the Interval day to second, call SQLBindCol interface returned that...
Read more >
Set interval of insert query of 10 second. - Microsoft Q&A
i want to set interval in insert query . ... Declare @Etime time(7); Declare @Chck_Status varchar(50); SET NOCOUNT ON;; if Not EXISTS ...
Read more >
To Insert Blocks at a Specified Interval Along an Object
Enter the name of the block. Enter y (Yes) to align the blocks with the selected object. Enter n (No) to use a...
Read more >
DB Insert to PostgreSQL column of type interval - KNIME Forum
My workaround is to build PostgreSQL value lists from the input data table and concatenate them to a combined values list. The trick...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found