Created
July 1, 2016 02:10
-
-
Save tristanwietsma/bc611463e0131f067f7e5633d0120ac0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
quant=> \d+ regsho | |
Table "public.regsho" | |
Column | Type | Modifiers | Storage | Stats target | Description | |
-------------+--------+-----------+----------+--------------+------------- | |
Symbol | text | | extended | | | |
Date | text | | extended | | | |
ShortVolume | bigint | | plain | | | |
TotalVolume | bigint | | plain | | | |
Indexes: | |
"ix_regsho_Date" btree ("Date") | |
"ix_regsho_Symbol" btree ("Symbol") | |
quant=> create table short_interest ( | |
quant(> ticker varchar(10), | |
quant(> date date, | |
quant(> shortvol bigint, | |
quant(> totalvol bigint | |
quant(> ); | |
CREATE TABLE | |
quant=> insert into short_interest select "Symbol" as ticker, cast("Date" as date) as date, "ShortVolume" as shortvol, "TotalVolume" as totalvol from regsho where "Symbol" is not null; | |
quant=> create unique index ticker_date_idx on short_interest (ticker, date); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment