Re: Dealing with tsvector in fuctions for data split - Mailing list pgsql-general

From Tom Lane
Subject Re: Dealing with tsvector in fuctions for data split
Date
Msg-id 27283.1186411310@sss.pgh.pa.us
Whole thread Raw
In response to Dealing with tsvector in fuctions for data split  (Francisco Reyes <lists@stringsutils.com>)
List pgsql-general
Francisco Reyes <lists@stringsutils.com> writes:

>     v_sql := 'INSERT INTO messagecatalog_'||
> to_char(NEW.timestampfield,'YYYY')||
>     '(field1, field2) values ('
>   ||New.field1||','||New.field2||')
>  ')';
>     EXECUTE v_sql;

This is not a particularly good way of accomplishing partitioning,
as you'll be needing *every* part of your application to be explicitly
aware of the exact partitioning scheme.

However, if you insist on doing it like that, don't you need
quote_literal() for the field values?

            regards, tom lane

pgsql-general by date:

Previous
From: M S
Date:
Subject: Re: Postgres service startup
Next
From: Henrik Zagerholm
Date:
Subject: Re: [PERFORM] Planner making wrong decisions 8.2.4. Insane cost calculations.