문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
psql [2019/09/19 00:45] gsjung |
psql [2021/04/13 06:54] (현재) |
||
---|---|---|---|
줄 23: | 줄 23: | ||
\d+ students | \d+ students | ||
+ | </ | ||
+ | < | ||
+ | nmap -Pnv -p 5432 ec2-54-251-188-3.ap-southeast-1.compute.amazonaws.com | ||
+ | |||
+ | </ | ||
+ | Get tables | ||
+ | < | ||
+ | with pg.connect(connect_string) as conn: | ||
+ | with conn.cursor() as cur: | ||
+ | cur.execute(""" | ||
+ | WHERE table_schema = ' | ||
+ | for table in cur.fetchall(): | ||
+ | print(table) | ||
+ | </ | ||
+ | < | ||
+ | CREATE TABLE public.volunteer | ||
+ | ( | ||
+ | id SERIAL PRIMARY KEY, | ||
+ | email character varying(100) COLLATE pg_catalog." | ||
+ | password character varying(100) COLLATE pg_catalog." | ||
+ | name character varying(100) COLLATE pg_catalog." | ||
+ | CONSTRAINT volunteer_email_key UNIQUE (email) | ||
+ | ) | ||
+ | </ | ||
+ | sqlalchemy | ||
+ | < | ||
+ | flask-sqlacodegen --flask --outfile tc.py " | ||
+ | </ | ||
+ | < | ||
+ | $ git remote add upstream https:// | ||
+ | $ git fetch upstream | ||
+ | $ git checkout master | ||
+ | $ git merge upstream/ | ||
+ | $ git push | ||
+ | </ | ||
+ | < | ||
+ | First install the extension | ||
+ | |||
+ | CREATE EXTENSION tsm_system_rows; | ||
+ | |||
+ | Then your query, | ||
+ | |||
+ | SELECT * | ||
+ | FROM table | ||
+ | TABLESAMPLE SYSTEM_ROWS(1000); | ||
</ | </ |