溫馨提示×

怎么在postgresql中判斷一個字段是否存在

養魚的貓咪
2250
2021-05-07 15:53:29
欄目: 云計算

在postgresql中判斷字段是否存在的方法:1.啟動postgresql服務;2.登錄postgresql數據庫;3.使用數據庫;4.執行命令判斷;

怎么在postgresql中判斷一個字段是否存在

具體步驟如下:

1.首先,在命令行中啟動postgresql服務;

net start postgresql

2.postgresql服務啟動后,在命令行中登錄到postgresql數據庫;

psql -h -U

3.登錄到postgresql數據庫后,在postgresql選擇一個數據庫并使用;

\c text

4.最后,進入到數據庫后,在數據庫中執行以下命令即可判斷一個字段是否存在;

select count(*) from information_schema.columns WHERE table_schema = 'table_schema' and table_name = 'table_name' and column_name = 'column_name';

0
亚洲午夜精品一区二区_中文无码日韩欧免_久久香蕉精品视频_欧美主播一区二区三区美女