ethereum-etl-postgres
ethereum-etl-postgres copied to clipboard
Fix: Syntax error in the schema
When I ran cat schema/*.sql | psql -U <my_db_username> -d <my_db_name> -h <my_host_address> --port <my_port> -a
I got the following error for the tokens
table:
(
address varchar(42),
name text,
symbol text,
decimals int(11),
total_supply numeric(78),
block_number bigint,
block_hash varchar(66),
block_timestamp timestamp
);
ERROR: syntax error at or near "("
LINE 6: decimals int(11),
Upon reviewing the code for the schema/tokens.sql
file, I saw that it had a size specified for the integer datatype and the int
datatype in PostgreSQL does not take any arguments. So, I removed the arguments for it, ran the table creation command again, and it worked!