Created
November 22, 2015 19:07
-
-
Save bcambel/a2c19be44ae011c4ae2c 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
| CREATE FUNCTION day_view_generator (day character varying) RETURNS void | |
| VOLATILE | |
| AS $$ | |
| BEGIN | |
| EXECUTE format('CREATE TABLE IF NOT EXISTS events_' || day || ' AS (SELECT 1 as pv, evt_name, hour, device_type, browser, os, domain, path, utm_source, utm_medium, utm_campaign, utm_content, utm_term, country FROM events limit 1)'); | |
| END; | |
| $$ LANGUAGE plpgsql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment