Skip to content

Instantly share code, notes, and snippets.

@dtest11
Last active August 25, 2021 15:19
Show Gist options
  • Save dtest11/66e9f5c86550bbe76ed821d698315196 to your computer and use it in GitHub Desktop.
Save dtest11/66e9f5c86550bbe76ed821d698315196 to your computer and use it in GitHub Desktop.
https://www.digitalocean.com/community/tutorials/how-to-install-postgresql-on-ubuntu-20-04-quickstart
sudo -i -u postgres
createuser --interactive
createdb test
在电脑本机商:
sudo adduser sammy
sudo -i -u sammy
psql 测试下
CREATE USER test WITH PASSWORD '123456';
# by me add
host all all 0.0.0.0/0 md5
select (extract(minute FROM to_timestamp(create_at))::int / 5) AS min5_slot,
date_trunc('hour', to_timestamp(create_at)) AS hour_stump,
create_at,
to_char(to_timestamp(create_at), 'HH12:MI:SS') as time,
extract(minute FROM to_timestamp(create_at))::int as minute,
remain_cups,remain_time
from ticket
@dtest11
Copy link
Author

dtest11 commented Aug 19, 2021

psql -h localhost -d testuser -U testuser -p 5432
Password for user testuser:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment