Postgres

sudo docker-compose exec postgres-server bash

CREATE TABLE transactions(
transactions_id serial PRIMARY KEY,
 cexio_xrp NUMERIC,
 bittrex_xrp NUMERIC,
 bittrex_btc NUMERIC,
 coindesk_btc NUMERIC,
 coinmarketcap_btc NUMERIC,
 time VARCHAR (355) NOT NULL
);

psql -h 127.0.0.1 -p 5432 -U postgres

drop table transactions;

INSERT INTO transactions (cexio, bittrex, coin, time)
 VALUES
 (0.3499, 0.347,'XRP','2019-04-02 22:40:51');

To change the data type of the asset_no column to integer, you use the statement below:

ALTER TABLE transactions ALTER COLUMN cexio TYPE NUMERIC;

select * from transactions;

docker-compose exec postgres-server bash -c 'psql -h 127.0.0.1 -p 5432 -U postgres -c "select * from transactions"'

https://pynative.com/python-postgresql-select-data-from-table/

Last updated

Was this helpful?