Results of 1 - 10 of about 51 for exist (0.001 sec.)
- CREATE TABLE Statement 12874
- The CREATE TABLE statement creates a table in the catalog. Examples Create a table with two integer columns ( i and j ): CREATE TABLE t1 (i INTEGER, j INTEGER); Create a table with a primary key: CREATE TABLE t1 (id INTEGER PRIMARY KEY, j V
...rectory = '/path/to/directory/'; CREATE OR REPLACE The CREATE OR REPLACE syntax allows a new table to be created or for an existing table to be overwritten by the new table. This is shorthand for dropping the existing table and then creating the new o...ne. Create a table with two integer columns (i and j) even if t1 already exists: CREATE OR REPLACE TABLE t1 (i INTEGER, j INTEGER); IF NOT EXISTS The IF NOT EXISTS syntax will only proceed with the cre...ation of the table if it does not already exist. If the table already exists, no action will be taken and the existing table will remain in the database. Create a table w... - https://man.mtool.work/duckdb/2.0/sql/statements/create_table.html
- CREATE INDEX Statement 11989
- CREATE INDEX The CREATE INDEX statement constructs an index on the specified column(s) of the specified table. Examples Create a unique index films_id_idx on the column id of table films : CREATE UNIQUE INDEX films_id_idx ON films (id); Cre
...duplicate values on column revenue of table films : CREATE INDEX s_idx ON films (revenue); Create index if it does not yet exist: CREATE INDEX IF NOT EXISTS s_idx ON films (revenue); The CREATE INDEX IF NOT EXISTS statement does not have an “early exi...t” at the moment, instead, it will attempt to create the index and only check its existence before committing it to storage. Therefore, it may run for a longer time compared to other IF NOT EXISTS statements, w...Description UNIQUE Causes the system to check for duplicate values in the table when the index is created (if data already exist) and each time data is added. Attempts to insert or update data that would result in duplicate entries will generate an er... - https://man.mtool.work/duckdb/2.0/sql/statements/create_index.html
- PostgreSQL Compatibility 10431
- DuckDB's SQL dialect closely follows the conventions of the PostgreSQL dialect. The few exceptions to this are listed on this page. Floating-Point Arithmetic DuckDB and PostgreSQL handle floating-point arithmetic differently for division by
...se quotes preserve the case. CREATE TABLE MyTaBLe (x INTEGER); SELECT * FROM "MyTaBLe"; ERROR: relation "MyTaBLe" does not exist PostgreSQL does not only treat quoted identifiers as case-sensitive; it treats all identifiers as case-sensitive, e.g., th...not work: CREATE TABLE "PreservedCase" (x INTEGER); SELECT * FROM PreservedCase; ERROR: relation "preservedcase" does not exist Therefore, case-insensitivity in PostgreSQL only works if you never use quoted identifiers with different cases. For DuckD...ELECT 1 == 1 AS t; DuckDB returns true , while PostgreSQL returns: postgres=# SELECT 1 == 1 AS t; ERROR: operator does not exist: integer == integer LINE 1: SELECT 1 == 1 AS t; Note that the use of == is not encouraged due to its limited portability.... - https://man.mtool.work/duckdb/2.0/sql/dialect/postgresql_compatibility.html
- CREATE TRIGGER Statement 9981
- New The CREATE TRIGGER feature was introduced in DuckDB 2.0. The CREATE TRIGGER statement registers a trigger: a set of SQL statements that run automatically in response to INSERT , UPDATE , or DELETE events on a table. Examples Record ever
...STATEMENT INSERT INTO price_changes DEFAULT VALUES; Drop a trigger: DROP TRIGGER trg_audit ON target; Drop a trigger if it exists: DROP TRIGGER IF EXISTS trg_audit ON target; Syntax The triggered statement is a single SQL statement, typically a data m...UPDATE . OLD TABLE contains the deleted or pre-update rows and is available for UPDATE and DELETE . OR REPLACE and IF NOT EXISTS CREATE OR REPLACE TRIGGER replaces an existing trigger with the same name. CREATE TRIGGER IF NOT EXISTS does nothing if a...trigger with the same name already exists on the table. Without either clause, creating a trigger with a name that already exists results in an error. The two clau... - https://man.mtool.work/duckdb/2.0/sql/statements/create_trigger.html
- Replacement Scans 9546
- The replacement scan API can be used to register a callback that is called when a table is read that does not exist in the catalog. For example, when a query such as SELECT * FROM my_table is executed and my_table does not exist, the replac
... - https://man.mtool.work/duckdb/2.0/clients/c/replacement_scans.html
- DROP Statement 9546
- The DROP statement removes a catalog entry added previously with the CREATE command. Examples Delete the table with the name tbl : DROP TABLE tbl; Drop the view with the name view1 ; do not throw an error if the view does not exist: DROP VI
...EW IF EXISTS view1; Drop function fn : DROP FUNCTION fn; Drop index idx : DROP INDEX idx; Drop schema sch : DROP SCHEMA sch; Drop sequ...E tbl RESTRICT; SELECT * FROM view1; This returns the following error message: Catalog Error: Table with name tbl does not exist! Limitations on Reclaiming Disk Space Running DROP TABLE should free the memory used by the table, but not always disk spa... - https://man.mtool.work/duckdb/2.0/sql/statements/drop.html
- Copying an In-Memory Database to a File 8872
- Imagine the following situation – you started DuckDB in in-memory mode but would like to persist the state of your database to disk. To achieve this, attach to a new disk-based database and use the COPY FROM DATABASE ... TO command : ATTACH
...abase.db'; COPY FROM DATABASE memory TO my_database; DETACH my_database; Ensure that the disk-based database file does not exist before attaching to it.... - https://man.mtool.work/duckdb/2.0/guides/snippets/copy_in-memory_database_to_fil...
- Typecasting 8662
- Typecasting is an operation that converts a value in one particular data type to the closest corresponding value in another data type. Like other SQL engines, DuckDB supports both implicit and explicit typecasting. Explicit Casting Explicit
...have any fields in common, then the cast was likely not intended. SELECT CAST({'a': 42} AS STRUCT(a VARCHAR)); Fields that exist in the target struct, but that do not exist in the source struct, default to NULL . SELECT CAST({'a': 42} AS STRUCT(a VARC...HAR, b VARCHAR)); Fields that only exist in the source struct are ignored. SELECT CAST({'a': 42, 'b': 43} AS STRUCT(a VARCHAR)); The names of the struct can also b... - https://man.mtool.work/duckdb/2.0/sql/data_types/typecasting.html
- ADBC Client 8437
- Installation To use the DuckDB ADBC client, download the libduckdb archive for your platform and follow the instructions below . For Python, install the duckdb package instead, as described in the Python section . The latest stable version
...ception of the ConnectionReadPartition , StatementExecutePartitions and StatementSetSubstraitPlan functions. The first two exist to support systems that internally partition the query results, which does not apply to DuckDB. Substrait plans are not su...pported. In this section, we will describe the main functions that exist in ADBC, along with the arguments they take and provide examples for each function. Database Set of functions that operate...TION_MODE : Mode Constant Description Create ADBC_INGEST_OPTION_MODE_CREATE Create a new table (error if the table already exists). This is the default. Append ADBC_INGEST_OPTION_MODE_APPEND Append to an existing table (error if the table does not exi... - https://man.mtool.work/duckdb/2.0/clients/adbc.html
- SQL on Pandas 8437
- Pandas DataFrames stored in local variables can be queried as if they are regular tables within DuckDB. import duckdb import pandas # Create a Pandas dataframe my_df = pandas.DataFrame.from_dict({'a': [42]}) # query the Pandas DataFrame "my
...DuckDB SQL queries is allowed by replacement scans , which replace instances of accessing the my_df table (which does not exist in DuckDB) with a table function that reads the my_df dataframe.... - https://man.mtool.work/duckdb/2.0/guides/python/sql_on_pandas.html
DuckDB 2.0 Documentation / man.mtool.work