Graybeard
Well-Known Member
SQL:
finance=# ALTER TABLE finance.nasdaqdaily1yr
ALTER COLUMN lastsale TYPE NUMERIC(15, 6);
ALTER TABLE
finance=# ALTER TABLE finance.nasdaqdaily1yr
ALTER COLUMN pctchange DROP NOT NULL;
ALTER TABLE
finance=# ALTER TABLE finance.nasdaqdaily1yr
ALTER COLUMN netchange TYPE NUMERIC(12, 6);
ALTER TABLE
finance=#
The data came from a MariaDB (like MySQL 8x) into progres SQL
Bash:
# Execute the COPY command using psql
psql -U "$PG_USER" -d "$PG_DATABASE" -c "$COPY_COMMAND"
+ psql -U ***** -d finance -c '\COPY finance.nasdaqdaily1yr(
last_day,symbol,name,lastsale,netchange,
pctchange,marketcap,country,ipoyear,volume,sector,industry)
FROM '\''/home/path/.../.../crlogical_update_2024-03-21_finance.nasdaqdaily1yr.csv'\''
WITH CSV HEADER DELIMITER '\'','\'' QUOTE '\''"'\'';'
COPY 174089
ChatGPT did the `grunt` work in 20 sec or each of the 3 errors and pushed out the correct code the first time <3 low cost worker