Dynamic queries for Partitions

From: Metatrader EA <metatraderea(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Dynamic queries for Partitions
Date: 2016-11-23 14:54:03
Message-ID: CAJNXAk2G_UBPXdji3bwRyDSPGJHms10wBC-jZ80PSm30tWGaZg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

When I run one query on one partitioned table.

Select * from customer where opendate = (date_trunc('month',
current_date)+'11 days'::interval)::date ;

This query will do that postgres will check all my partitions.

How can I do ?

Step 1 generate one sql that will be like "Select * from customer where
opendate = '2016-11-01' ;

Step 2 :: Then run code from step1.

Any advice?

//Bill

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Jan Ostrochovsky 2016-11-24 09:22:49 Re: Dynamic queries for Partitions
Previous Message Michael Moore 2016-11-15 23:10:09 Re: Only target lines of text