0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

pgAdminを基本からまとめてみた【基本】

Last updated at Posted at 2023-08-12
  1. Serversをクリックし、『Register』⇨『Server』を選択し、
    サーバーの名前を記入する。

  2. Connectionを選択し、Hostにlocalhost、Passwordを記入して
    右下の『Save』を押す。

  3. 新しいアイコンが表示されるとデータベースに接続される。

  4. アイコンをクリックして、『Database』⇨『Create』⇨ 『Database』を順に選択して、フォームに記入して作成をする。

  5. 『Database』を選択すると上部にある全てのボタンが有効になる。

  6. 『クエリツール』をクリックする。
    ※クエリツール:Databaseに▶︎があるボタン

  7. pgAdmin内で、新しいタブが作成されている。
    ※タブのタイトルには、Postgresのユーザー名、データベース、postgres Demoのサーバー名が含まれている

  8. 上部のプルダウンは、他の接続及びサーバーを選択できる。

  9. 右端にある『Scratch Pad』は、クエリや別の外部エディタにテキストを追加するのではなく、クエリを操作する時にテキストの一部を保存する場合に役立つ。

  10. CREATE TABKEステートメントを作成したら、F5か『▶︎』をクリックすることで、クエリを実行できる。

sample.sql
CREATE TABLE pgtest (
testval VACHAR(10)
);

※ Query returned successfully in 394 msec.と表示されたら成功

  1. テーブルが出来たので、データを挿入する。
sample.sql
INSERT INTO pgtest (testval)
VALUES("Hello");

SELECT testval
FROM pgtest;
  1. F5か『▶︎』をクリックすることで、ステートメントが実行される。

参考サイト

pgAdmin Tutorial - How to Use pgAdmin

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?