2023年07月24日

FastAPI Ubuntu20.04 PostgreSQL

sudo apt update
sudo apt install postgresql postgresql-contrib  //ver12
----------------
sudo -u postgres psql

CREATE DATABASE test_2;
CREATE USER postgres WITH ENCRYPTED PASSWORD 'Psswd643';
GRANT ALL PRIVILEGES ON DATABASE test_2 TO postgres;
\q
----------------
sudo gedit /etc/postgresql/12/main/postgresql.conf

sudo service postgresql restart
----------
sudo apt install python3-pip
pip install fastapi[all] 
sudo apt install uvicorn
pip install asyncpg sqlalchemy
pip install sqlalchemy psycopg2-binary


cd f1
uvicorn main:app --host 0.0.0.0

posted by a23 at 14:50| Comment(0) | REST API

2023年07月08日

PostgREST 11.1.0 Ubuntu22.04LTS Error printed: /postgrest: 1: Syntax error: ")" unexpected

Dockerを使用しない使い方が知りたい
I want to know how to use without using Docker

参考ページ

手元の環境 environment at hand
 Ubuntu22.04LTS
 PostGRESQL14
 PostgREST 11.1.0
 出力されたエラー Error printed:    /postgrest: 1: Syntax error: ")" unexpected 

やってみたこと What I tried 
このサイトから from this site
ダウンロード
postgrest-v11.1.0-ubuntu-aarch64.tar.xz

mkdir /home/uu20/prest

cd ダウンロード

sudo mv postgrest-* /home/uu20/prest
cd /home/uu20/prest
tar -xvf postgrest-v11.1.0-ubuntu-aarch64.tar.xz

03.png
04.png
05.png
06.png
sudo ./postgrest -h
07.png

sudo apt-get install libpq-dev
sudo ./postgrest -h
08.png





PostgreSQLは起動済み PostgreSQL is already started
psql --version
sudo su - postgres
psql
22.png


Tutorial 0 - Get it Running
Step 2. I think Install PostgreSQL doesn't understand
I want to know how to use without using Docker






posted by a23 at 09:36| Comment(0) | PostgreSQL