Just wanted to say thanks again for the help to those that responded. For
anyone curious, this helped me get a more advanced constraint exclusion
feature finished for the partition manager I've been working on
http://www.keithf4.com/managing-constraint-exclusion-in-table-partitioning/
--
Keith Fi
David,
That seems to have fixed it! I was going down a path of grabbing the
column's type from pg_attribute and trying to work from there, but was
still having some of the same issues.
Thanks everyone else that replied as well!
--
Keith Fiske
Database Administrator
OmniTI Computer Consulting, In
On 01/06/2014 07:42 AM, David Johnston wrote:
Adrian Klaver-3 wrote
In the real function I'm writing, the columns to be used in the string
being created are pulled from a configuration table, so their types
could be anything. So casting the quote_literal() calls is not really an
option here.
Adrian Klaver-3 wrote
>>
>>
>> In the real function I'm writing, the columns to be used in the string
>> being created are pulled from a configuration table, so their types
>> could be anything. So casting the quote_literal() calls is not really an
>> option here.
>>
>> Any help would be appreciate
That is not an option either. This is for a publicly released extension and
I'm really not going to go requiring another scripting language be
installed, especially an untrusted one.
--
Keith Fiske
Database Administrator
OmniTI Computer Consulting, Inc.
http://www.keithf4.com
On Sun, Jan 5, 201
2014/1/6 Keith Fiske
> That fixed it! In the example and my original as well. Thank you very much!
>
> And wow that was incredibly misleading where the cast was supposed to go
> going by the error given and when it was thrown. That EXECUTE statement
> works perfectly fine, seeing as the v_record
On 01/05/2014 08:43 PM, Keith Fiske wrote:
I can't remove the quote_literal() because the value could potentially
be a string, time, or number. Without the loop, quote_literal() handles
the variable being any one of those types without any issues and quotes
(or doesn't) as needed.
Well I tried
On 01/05/2014 08:34 PM, Keith Fiske wrote:
Actually, that doesn't work right. Gives weird results when the column
is an integer
Example:
keith=# select min(col1), max(col1) from
partman_test.time_static_table_p2014_01_01;
min | max
-+-
86 | 100
(1 row)
keith=# select min(col1::tex
I can't remove the quote_literal() because the value could potentially be a
string, time, or number. Without the loop, quote_literal() handles the
variable being any one of those types without any issues and quotes (or
doesn't) as needed.
--
Keith Fiske
Database Administrator
OmniTI Computer Consu
On 01/05/2014 08:34 PM, Keith Fiske wrote:
Actually, that doesn't work right. Gives weird results when the column
is an integer
Example:
keith=# select min(col1), max(col1) from
partman_test.time_static_table_p2014_01_01;
min | max
-+-
86 | 100
(1 row)
keith=# select min(col1::tex
On 01/05/2014 08:23 PM, Keith Fiske wrote:
That fixed it! In the example and my original as well. Thank you very much!
And wow that was incredibly misleading where the cast was supposed to go
going by the error given and when it was thrown. That EXECUTE statement
works perfectly fine, seeing as
Actually, that doesn't work right. Gives weird results when the column is
an integer
Example:
keith=# select min(col1), max(col1) from
partman_test.time_static_table_p2014_01_01;
min | max
-+-
86 | 100
(1 row)
keith=# select min(col1::text), max(col1::text) from
partman_test.time_stat
That fixed it! In the example and my original as well. Thank you very much!
And wow that was incredibly misleading where the cast was supposed to go
going by the error given and when it was thrown. That EXECUTE statement
works perfectly fine, seeing as the v_record variable got its assignment
with
On 01/05/2014 06:31 PM, Keith Fiske wrote:
Running into an issue trying to dynamically create some SQL statements
in a plpgsql function. The function below is as simple an example I can
make to reproduce the error. The first loop works without any issues,
but the second throws an error.
CREATE O
Sorry, forgot to include that I've tested this on PostgreSQL versions 9.2.6
and 9.3.2 and same thing happens on both.
--
Keith Fiske
Database Administrator
OmniTI Computer Consulting, Inc.
http://www.keithf4.com
On Sun, Jan 5, 2014 at 9:31 PM, Keith Fiske wrote:
> Running into an issue trying
Running into an issue trying to dynamically create some SQL statements in a
plpgsql function. The function below is as simple an example I can make to
reproduce the error. The first loop works without any issues, but the
second throws an error.
CREATE OR REPLACE FUNCTION testing_record() RETURNS v
16 matches
Mail list logo