Postgresqlデータベーステーブル情報クエリーsql文(更新継続)について

845 ワード

  • すべてのデータベースshow databases;(mysql) select * from pg_database;(postgresql)
  • を問い合わせる
  • クエリーデータベースのすべてのテーブル情報
  • show tables;(mysql)
    select * from information_schema.tables where table_schema='public';(postgresql)
    
  • クエリーデータベースusersテーブルすべてのフィールド情報
  • desc users;(mysql)
    select * from information_schema.columns where table_name='users';(postgresql)
    
  • フィールドタイプalter table "users" alter column created_date type timestamp;
  • を変更
  • ストレージ・プロシージャの作成
  • create or replace function updateTimeType() returns void as
    $body$
        declare
        begin
    
        end;
    $body$ language plpgsql;
    
  • クエリーストレージプロセスSELECT *from newprocedure();
  • ストレージプロセスDROP FUNCTION newprocedure();
  • を削除する.