資料庫-Duckdb-catalog和schema

辰令發表於2024-06-11

建立資料庫

1.會有一個或者兩個檔案
  .duckbd
  .wal	  
2.  使用者的資料庫名稱--databasename-database_oid
資料庫物件表的全限定名可表示為:Catalog名.Schema名.表名 
 01. DuckDB's two internal database schema names, system and temp . 有兩個內部的資料schema_name 
    TEMP_CATALOG    SYSTEM_CATALOG  INVALID_CATALOG
 02.   name of current database (called "catalog" in the SQL standard)
  DEFAULT_SCHEMA
   DefaultSchema:  information_schema  pg_catalog
	
跨模式訪問--當前模式schema訪問其他schema  search_path也稱模式搜尋路徑	
 
    ##參考: https://duckdb.org/docs/sql/keywords_and_identifiers.html
	 system or built-in database.
	 a user-defined database
   search_path 來進行設定 catalog_name:	 
   預設的search schema --main  
database/catalog_name: mydata system temp
schema_name: information_schema main pg_catalog 
對應檔案:system temp
3.DuckDB offers a collection of table functions that provide metadata about the current database. 
  These functions reside in the main schema and their names are prefixed with duckdb_.
   儲存在 main schema內的
   
   
4.具體示例如下:
 mydata	
    information_schema main pg_catalog 
 system 
    information_schema main pg_catalog 
 temp
    information_schema main pg_catalog
	
內容:main中有
      These functions reside in the main schema and their names are prefixed with duckdb_	

瞭解和檢視

duckdb_schemas
duckdb_databases
duckdb_keywords()

學習和使用

SELECT * FROM duckdb_settings();		  

相關文章