How does the search_path influence identifier resolution and the “current schema”

前端 未结 2 2127
旧时难觅i
旧时难觅i 2020-11-21 06:18

Is it possible to define in which schema new tables get created by default? (Referred by \"unqualified table names\".)

I\'ve seen some details about using the \"sear

2条回答
  •  庸人自扰
    2020-11-21 06:26

    Search path is indeed what you want:

    % create schema blarg;
    % set search_path to blarg;
    % create table foo (id int);
    % \d
           List of relations
     Schema | Name | Type  | Owner 
    --------+------+-------+-------
     blarg  | foo  | table | pgsql
    

提交回复
热议问题