Search Postgresql Archives

Re: Directing Partitioned Table Searches

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 7, 2011 at 1:17 PM, Bill Thoen <bthoen@xxxxxxxxxx> wrote:
> Thanks. That sounds simple enough. Since I want to automate this, I guess
> the next step is to learn how to create and  execute a "dynamic" query.  I
> think I know how to do that.
>

In perl, it looks something like this:

$part = compute_partition($value);
$sth = $dbh->prepare("select * from table_$part where foo=?");
$sth->execute($value);

you just interpolate the parts you need in the query string.

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux