0001-feeder-add-UNLOGGED-parameter-to-created-SQL-tables-.patch
wcs_olap/feeder.py | ||
---|---|---|
384 | 384 |
self.ex('DROP TABLE IF EXISTS %s;' % tablename) |
385 | 385 | |
386 | 386 |
def do_dates_table(self): |
387 |
self.ex('CREATE TABLE IF NOT EXISTS public.dates (date date, day text, month text)') |
|
387 |
self.ex('CREATE UNLOGGED TABLE IF NOT EXISTS public.dates (date date, day text, month text)')
|
|
388 | 388 |
self.ex('CREATE INDEX IF NOT EXISTS dates_index ON public.dates (date)') |
389 | 389 |
self.ex('SELECT MIN(date) FROM public.dates') |
390 | 390 |
max_date = self.cur.fetchone()[0] |
... | ... | |
403 | 403 |
vars=[first_date, last_date]) |
404 | 404 | |
405 | 405 |
def create_table(self, name, columns, inherits=None, comment=None): |
406 |
sql = 'CREATE TABLE %s' % quote(name) |
|
406 |
sql = 'CREATE UNLOGGED TABLE %s' % quote(name)
|
|
407 | 407 |
sql += '(' + ', '.join('%s %s' % (quote(n), t) for n, t in columns) + ')' |
408 | 408 |
if inherits: |
409 | 409 |
sql += ' INHERITS (%s)' % quote(inherits) |
410 |
- |