27 lines
744 B
Plaintext
27 lines
744 B
Plaintext
ubuntu@postgress-test:~$ psql -h 192.168.199.129 -U app_user -d app_db
|
|
Password for user app_user:
|
|
psql (16.14 (Ubuntu 16.14-0ubuntu0.24.04.1), server 15.18)
|
|
Type "help" for help.
|
|
|
|
app_db=> CREATE TABLE users (
|
|
id SERIAL PRIMARY KEY,
|
|
name VARCHAR(100),
|
|
email VARCHAR(100) UNIQUE,
|
|
created_at TIMESTAMP DEFAULT NOW()
|
|
);
|
|
|
|
INSERT INTO users (name, email) VALUES
|
|
('Alice', 'alice@example.com'),
|
|
('Bob', 'bob@example.com');
|
|
|
|
SELECT * FROM users;
|
|
CREATE TABLE
|
|
INSERT 0 2
|
|
id | name | email | created_at
|
|
----+-------+-------------------+----------------------------
|
|
1 | Alice | alice@example.com | 2026-06-09 19:45:38.658698
|
|
2 | Bob | bob@example.com | 2026-06-09 19:45:38.658698
|
|
(2 rows)
|
|
|
|
app_db=>
|