本文介绍了如何在postgres中检查用户定义的表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
除了检查表是否已存在之外,我们如何验证它是否为postgres中当前的用户定义表
apart from checking if table already exists, how can we verify if it is current user-defined table in postgres
CREATE TABLE IF NOT EXISTS tbl1()我们如何验证它是否由当前用户创建(如果已存在)?
how can we verify it was created by current user if already exists?
推荐答案像这样尝试
SELECT count(*) as cnt FROM pg_tables t where tableowner=current_user and tablename='Tablename' and schemaname='schemaneme' if cnt = 0 then (CREATE Table TableName)更多推荐
如何在postgres中检查用户定义的表?
发布评论