报权限不够:

-- 对游客预定来源进行mock
insert into m_qunar_train(departure_city, resident_city, order_count, person_count, male_count, female_count, age_0018,
                          age_1925, age_2635, age_3645, age_4655, age_56ab, order_with_children, order_without_children,
                          order_time, use_time)

select departure_city,
       resident_city,
       order_count,
       person_count,
       male_count,
       female_count,
       age_0018,
       age_1925,
       age_2635,
       age_3645,
       age_4655,
       age_56ab,
       order_with_children,
       order_without_children,
       replace(to_char(order_time, 'yyyy-MM-dd HH24:MI:SS'), '2020', '2021')::timestamp,
       use_time
from m_qunar_train
where order_time between '2020-09-09' and '2020-12-31';

在执行上面语句的时候,报错:

原因是用户没有相应的权限,此权限允许使用currval和nextval函数。

 

-- 添加授权之后
grant USAGE, SELECT on all sequences in schema public to songjiangjiang;
Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐