Comments (4)
import duckdb
conn = duckdb.connect()
conn.sql(
f"""
DROP TABLE IF EXISTS meta_test;
CREATE TABLE meta_test (
id TEXT NOT NULL UNIQUE,
last_ts TIMESTAMPTZ,
first_ts TIMESTAMPTZ,
PRIMARY KEY (id),
);
"""
)
conn.sql(
f"""
INSERT INTO meta_test (id, last_ts, first_ts)
VALUES ('uuid42', NULL, NULL)
ON CONFLICT (id)
DO UPDATE
SET last_ts = NULL
"""
)
runs without problems
from duckdb.
statement ok
CREATE TABLE meta_test (
id TEXT NOT NULL UNIQUE,
last_ts TIMESTAMPTZ,
first_ts TIMESTAMPTZ,
PRIMARY KEY (id),
);
statement ok
INSERT INTO meta_test (id, last_ts, first_ts)
VALUES ('uuid42', NULL, NULL)
ON CONFLICT (id)
DO UPDATE
SET last_ts = NULL
statement ok
INSERT INTO meta_test (id, last_ts, first_ts)
VALUES ('uuid42', NULL, NULL)
ON CONFLICT (id)
DO UPDATE
SET last_ts = NULL
query III
select * from meta_test;
----
uuid42 NULL NULL
also runs without problems
from duckdb.
Could it be postgres extension specific then?
Here's my connection setup:
duckdb.install_extension("postgres")
duckdb.load_extension("postgres")
def postgres_connection(tz="UTC"):
db_config = settings[env_settings.ts_datastore]
conn = duckdb.connect(
f"postgres:user={db_config.user} password={db_config.password} host={db_config.host} dbname={db_config.db_name}"
)
conn.sql(f"SET timezone to '{tz}'")
return conn
Edit: appears to be the case, the query works fine if I use in-memory database, but fails when connected to postgres.
from duckdb.
from duckdb.
Related Issues (20)
- `DROP TABLE` does not free memory (in-memory database) HOT 5
- Slow fetch_df() on S3 remote query HOT 5
- `AT TIME ZONE` no longer supports a timezone number (i.e. `-0400`) which used to work on v1.0.0 HOT 4
- To create table containing a column with enum array HOT 1
- JSON parsing exception: Arrow datatype Map(Field ... ) not supported by Polars HOT 1
- Unit tests of built Python package fail on OSX (in conda-forge build) HOT 1
- read_json_auto parametric url from subquery HOT 4
- [Python] Implicit conversion from string to integer when using Pandas DF with NULL only column HOT 2
- How can I call the pre-Spring 2024 CSV parser in v1.1.1? HOT 8
- Rejected Rows should at least display an error or warning once csv loaded
- Sniff_csv is providing incorrect information about delimeter HOT 7
- read_csv_auto Loads data to a different column for a specific row when provided some UTF-8/Unicode sequences HOT 2
- If one of row is malformed in csv , all data is loaded to a single column HOT 2
- v1.1.1 errors with 'cannot have dictionary offsets without seeing a non-empty dictionary first' HOT 5
- DROP TABLE does not reduce database size HOT 2
- Issue found SQL on Pandas HOT 6
- Error message when omitting `from` could be friendlier HOT 1
- Internal Error when a CTE query with DISTINCT(ON) is used twice with UNION HOT 5
- pd.NA values get coerced to 0.0 for a pd.Float64DType
- Failed to create prepared statement for insert-statement after called ToString method
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from duckdb.