Error Connecting EdgeDB - IntervalStyle Parameter Ignored

I am super excited to start using Neon!

My use case currently is using EdgeDB and I want to use Neon as the Postgres backend for it. However, on initialization, EdgeDB fails because the interval style parameter in Postgres seems to be ignored. Not sure if this is a bug, or has currently been left off and will be added later?

I would also be happy to contribute to add this in so I can start using Neon if needed!

Can you show how you set and use it?

Just checked and for me it seems to be working fine:

main=> SET intervalstyle = 'sql_standard';
SET

main=> SELECT make_interval(1, 2, 3, 4, 5, 6, 7);
   make_interval   
-------------------
 +1-2 +25 +5:06:07
(1 row)

main=> SET intervalstyle = 'postgres';
SET

main=> SELECT make_interval(1, 2, 3, 4, 5, 6, 7);
         make_interval          
--------------------------------
 1 year 2 mons 25 days 05:06:07
(1 row)

I am connecting via asyncpg. Here is a code snippet you can use to reproduce the problem:

import asyncpg
import asyncio

async def main():
    conn = await asyncpg.connect("<neon-dsn>", server_settings={"IntervalStyle": "iso_8601"})
    print(await conn.fetchval("select to_json('0 seconds'::interval)"))

asyncio.run(main())

I would expect this to return “PT0S” but instead get “00:00:00”

Okay so looking at this, it seems like through the UI on the SQL editor it works. There is something about the way asyncpg tries to set this that neon doesn’t like?

I think you’re hitting this bug; the neon proxy is not forwarding server settings like IntervalStyle correctly.

As a workaround, you can set IntervalStyle by issuing set intervalstyle = 'iso_8601'; command first in the connection. Is there a way to do that with EdgeDB?

There is no way around this. This happens at bootstrapping time when the DB is getting set up. So none of it is exposed to the user. I looked at the issue and its track. It seems that not much progress has been made to fixing it yet. Is there a timeline on when this might be fixed?

Is this something I could contribute to?