Advertisement
Guest User

Untitled

a guest
Nov 10th, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. try:
  2.     conn = psycopg2.connect("dbname='discordLogs' user='discord' host='localhost' password=''")
  3.     cursor = conn.cursor()
  4. except Exception as e:
  5.     print("Can't connect to db")
  6.     print(e)
  7.     sys.exit()
  8.  
  9. cursor.execute("""CREATE TABLE public.test_messages
  10. (
  11.     message_id bigint NOT NULL,
  12.     author_id bigint,
  13.     "timestamp" timestamp with time zone,
  14.     edited_timestamp timestamp with time zone,
  15.     reaction_names character varying(50)[],
  16.     reaction_counts integer[],
  17.     message text,
  18.     CONSTRAINT test_messages_pkey PRIMARY KEY (message_id)
  19. )
  20. """)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement