[HACKERS] Query not using index for user defined type

2013-04-15 Thread Rodrigo Barboza
Hi guys. I created a type 'mytype' (an unsigned int) and created an operator class for index. Then I created a table with a column of my type and isnerted 1000 entries. But no matter how many entries I have in the table, it never uses the index. It always does a seq scan. Here is the explain

Re: [HACKERS] Query not using index for user defined type

2013-04-15 Thread Rodrigo Barboza
On Mon, Apr 15, 2013 at 5:33 PM, Tom Lane t...@sss.pgh.pa.us wrote: Rodrigo Barboza rodrigombu...@gmail.com writes: I created a type 'mytype' (an unsigned int) and created an operator class for index. Then I created a table with a column of my type and isnerted 1000 entries

Re: [HACKERS] Query not using index for user defined type

2013-04-15 Thread Rodrigo Barboza
On Mon, Apr 15, 2013 at 7:51 PM, Tom Lane t...@sss.pgh.pa.us wrote: Rodrigo Barboza rodrigombu...@gmail.com writes: I created a implic cast for mytype to bigint. So when I do the same query it does seq scan, because the column is transformed into bigint. Yeah. One reason why there's

Re: [HACKERS] Unrecognized type error (postgres 9.1.4)

2013-04-09 Thread Rodrigo Barboza
On Tue, Apr 9, 2013 at 3:05 AM, Amit Kapila amit.kap...@huawei.com wrote: On Monday, April 08, 2013 7:28 PM Rodrigo Barboza wrote: On Sat, Apr 6, 2013 at 10:39 PM, Rodrigo Barboza rodrigombu...@gmail.com wrote: Ok! I will try to reproduce in a smaller scenario. On Sat, Apr 6, 2013 at 9:53 PM

Re: [HACKERS] Unrecognized type error (postgres 9.1.4)

2013-04-09 Thread Rodrigo Barboza
On Wed, Apr 10, 2013 at 12:24 AM, Amit Kapila amit.kap...@huawei.comwrote: On Tuesday, April 09, 2013 6:19 PM Rodrigo Barboza wrote: On Tue, Apr 9, 2013 at 3:05 AM, Amit Kapila amit.kap...@huawei.com wrote: On Monday, April 08, 2013 7:28 PM Rodrigo Barboza wrote: You have identified

Re: [HACKERS] Unrecognized type error (postgres 9.1.4)

2013-04-08 Thread Rodrigo Barboza
On Mon, Apr 8, 2013 at 11:25 AM, Tom Lane t...@sss.pgh.pa.us wrote: Rodrigo Barboza rodrigombu...@gmail.com writes: UPDATE tm32 SET a = a + 1 WHERE a $i; ERROR: unsupported type: 202886 I'm betting that's coming from scalargtsel, which doesn't know anything about your type, but you've

Re: [HACKERS] Unrecognized type error (postgres 9.1.4)

2013-04-08 Thread Rodrigo Barboza
On Mon, Apr 8, 2013 at 11:27 AM, Rodrigo Barboza rodrigombu...@gmail.comwrote: On Mon, Apr 8, 2013 at 11:25 AM, Tom Lane t...@sss.pgh.pa.us wrote: Rodrigo Barboza rodrigombu...@gmail.com writes: UPDATE tm32 SET a = a + 1 WHERE a $i; ERROR: unsupported type: 202886 I'm betting that's

Re: [HACKERS] Unrecognized type error (postgres 9.1.4)

2013-04-08 Thread Rodrigo Barboza
On Mon, Apr 8, 2013 at 11:44 AM, Rodrigo Barboza rodrigombu...@gmail.comwrote: On Mon, Apr 8, 2013 at 11:27 AM, Rodrigo Barboza rodrigombu...@gmail.comwrote: On Mon, Apr 8, 2013 at 11:25 AM, Tom Lane t...@sss.pgh.pa.us wrote: Rodrigo Barboza rodrigombu...@gmail.com writes: UPDATE

Re: [HACKERS] Unrecognized type error (postgres 9.1.4)

2013-04-08 Thread Rodrigo Barboza
On Mon, Apr 8, 2013 at 12:14 PM, Rodrigo Barboza rodrigombu...@gmail.comwrote: On Mon, Apr 8, 2013 at 11:44 AM, Rodrigo Barboza rodrigombu...@gmail.comwrote: On Mon, Apr 8, 2013 at 11:27 AM, Rodrigo Barboza rodrigombu...@gmail.com wrote: On Mon, Apr 8, 2013 at 11:25 AM, Tom Lane

Re: [HACKERS] Unrecognized type error (postgres 9.1.4)

2013-04-08 Thread Rodrigo Barboza
On Mon, Apr 8, 2013 at 4:30 PM, Rodrigo Barboza rodrigombu...@gmail.comwrote: On Mon, Apr 8, 2013 at 12:14 PM, Rodrigo Barboza rodrigombu...@gmail.comwrote: On Mon, Apr 8, 2013 at 11:44 AM, Rodrigo Barboza rodrigombu...@gmail.com wrote: On Mon, Apr 8, 2013 at 11:27 AM, Rodrigo

Re: [HACKERS] Unrecognized type error (postgres 9.1.4)

2013-04-06 Thread Rodrigo Barboza
On Sat, Apr 6, 2013 at 12:23 AM, Amit Kapila amit.kap...@huawei.com wrote: On Saturday, April 06, 2013 3:57 AM Rodrigo Barboza wrote: Hello. I created a type my_uint that is a unsigned int 32. I am trying to update data of a table that contains a column of this type. Here is what

Re: [HACKERS] Unrecognized type error (postgres 9.1.4)

2013-04-06 Thread Rodrigo Barboza
Ok! I will try to reproduce in a smaller scenario. On Sat, Apr 6, 2013 at 9:53 PM, Amit Kapila amit.kap...@huawei.com wrote: On Saturday, April 06, 2013 12:18 PM Rodrigo Barboza wrote: On Sat, Apr 6, 2013 at 12:23 AM, Amit Kapila amit.kap...@huawei.com wrote: On Saturday, April 06, 2013 3

[HACKERS] Unrecognized type error (postgres 9.1.4)

2013-04-05 Thread Rodrigo Barboza
Hello. I created a type my_uint that is a unsigned int 32. I am trying to update data of a table that contains a column of this type. Here is what happens: postgresql= explain analyze UPDATE attribute_type_conf SET rowform = rowform +1 where rowform = 18; ERROR: unsupported type: 132852

[HACKERS] Why there is a PG_GETARG_UINT32 and PG_RETURN_UINT32?

2013-04-04 Thread Rodrigo Barboza
Hi guys. I am wondering when I can use the PG_GETARG_UINT32 and PG_RETURN_UINT32. If postgres has no unsigned int type, what is the use of these macros?

Re: [HACKERS] Why there is a PG_GETARG_UINT32 and PG_RETURN_UINT32?

2013-04-04 Thread Rodrigo Barboza
On Fri, Apr 5, 2013 at 1:12 AM, Amit Kapila amit.kap...@huawei.com wrote: On Thursday, April 04, 2013 8:30 PM Rodrigo Barboza wrote: Hi guys. I am wondering when I can use the PG_GETARG_UINT32 and PG_RETURN_UINT32. If postgres has no unsigned int type, what is the use of these macros

[HACKERS] c language functions

2013-04-03 Thread Rodrigo Barboza
Hello. I'm trying to create a generic add function. I have defined a type my_uint and it needs a '+' operator. This operator should work like normal int + int operation. The function is defined expecting arguments (my_uint, anyelement). I'm confused in retrieving the anyelement type, value and

Re: [HACKERS] c language functions

2013-04-03 Thread Rodrigo Barboza
Why not useful? If I don't make it receive anyelement, I will have to create an add function for each type. Correct me if I'm wrong. On Wed, Apr 3, 2013 at 2:27 PM, Robert Haas robertmh...@gmail.com wrote: On Wed, Apr 3, 2013 at 11:26 AM, Rodrigo Barboza rodrigombu...@gmail.com wrote: Hello

Re: [HACKERS] c language functions

2013-04-03 Thread Rodrigo Barboza
Well, I was checking inside my function the type of the second argument and switching between the allowed types. This way kind of does the same thing of many functions, doesn't it? On Wed, Apr 3, 2013 at 3:39 PM, Tom Lane t...@sss.pgh.pa.us wrote: Rodrigo Barboza rodrigombu...@gmail.com writes

Re: [HACKERS] c language functions

2013-04-03 Thread Rodrigo Barboza
I see, that's true. I'm returning unknown type, there is a little more overhead. But it's working now. =] Thanks for the help guys! On Wed, Apr 3, 2013 at 6:17 PM, Robert Haas robertmh...@gmail.com wrote: On Wed, Apr 3, 2013 at 3:25 PM, Rodrigo Barboza rodrigombu...@gmail.com wrote: Well, I