Re: [HACKERS] Coding help

2003-11-09 Thread Tom Lane
Christopher Kings-Lynne <[EMAIL PROTECTED]> writes: > It occurs to me then that I could just then use FloatOnly in the grammar I don't think so, unless you are proposing something very odd in the lexer to force it to treat an integer literal as a float in this one context. What is the problem wi

Re: [HACKERS] Coding help

2003-11-09 Thread Christopher Kings-Lynne
I thought the whole problem here is that OIDs are unsigned ints, hence intVal() won't allow the highest OIDs? Exactly. That's why you need to handle T_Float too. See the int8 example, which has just the same problem. It occurs to me then that I could just then use FloatOnly in the grammar and

Re: [HACKERS] Coding help

2003-11-09 Thread Tom Lane
Christopher Kings-Lynne <[EMAIL PROTECTED]> writes: >> ... you can use code comparable to define.c's defGetInt64() >> to convert the Value node into a numeric OID, ie, either do intVal() or >> a call of oidin(). > I thought the whole problem here is that OIDs are unsigned ints, hence > intVal() w

Re: [HACKERS] Coding help

2003-11-09 Thread Christopher Kings-Lynne
| COMMENT ON LARGE OBJECT NumericOnly IS comment_text n->objname = makeList1(makeAConst($5)); Forget the makeAConst step --- it's just wasted cycles. In the execution routine, you can use code comparable to define.c's defGetInt64() to convert the Value node into a numeric OID, ie, either do in

Re: [HACKERS] Coding help

2003-11-09 Thread Tom Lane
Christopher Kings-Lynne <[EMAIL PROTECTED]> writes: > | COMMENT ON LARGE OBJECT NumericOnly IS comment_text > n->objname = makeList1(makeAConst($5)); Forget the makeAConst step --- it's just wasted cycles. In the execution routine, you can use code comparable to define.c's defGetInt64() to conv

Re: [HACKERS] Coding help

2003-11-09 Thread Bruce Momjian
Christopher Kings-Lynne wrote: > > > The only idea I have is to call oidin() to do the conversion from string > > to oid. I see this in copy.c: > > > > loaded_oid = DatumGetObjectId(DirectFunctionCall1(oidin, > >CStringGetDatum(

Re: [HACKERS] Coding help

2003-11-09 Thread Christopher Kings-Lynne
The only idea I have is to call oidin() to do the conversion from string to oid. I see this in copy.c: loaded_oid = DatumGetObjectId(DirectFunctionCall1(oidin, CStringGetDatum(string))); if (loaded_oid == Inval

Re: [HACKERS] Coding help

2003-11-08 Thread Bruce Momjian
I guess you are asking how to get the NumericOnly converted to an oid, and I see from the code that there are very few places where we allow oid's to be supplied directly. Most oid's come in as part of our numberic conversion code. The only idea I have is to call oidin() to do the conversion fro

[HACKERS] Coding help

2003-10-26 Thread Christopher Kings-Lynne
Hi guys, I've asked this of a few people now, but I haven't managed to get a straightforward solution. I'm working on COMMENT ON LARGE OBJECT. If you could help me with this one, it would be really cool. Other than this, comment on language, conversion, cast and operator class are all done. Th

Re: [HACKERS] Coding help

2002-08-16 Thread Matthew T. O'Connor
Absolutely, I have been looking into this and I have some thoughts, but right now all I was trying to do was some rough implementations just to help me make sure I understand all / most of the issues. I am very new to hacking on the guts of the backend. I plan on posting a formal proposal w

Re: [HACKERS] Coding help

2002-08-16 Thread Jan Wieck
"Matthew T. O'Connor" wrote: > > Hello, I'm playing with creating an auto vacuum daemon, but it is my first > time inside the pg source code and I'm a bit lost. > > I have gotten as far as having a vacuum daemon created on postmaster startup. > It's just a fork from the postmaster, cribbed mostl

Re: [HACKERS] Coding help

2002-08-15 Thread Tom Lane
"Matthew T. O'Connor" <[EMAIL PROTECTED]> writes: > I have gotten as far as having a vacuum daemon created on postmaster startup. > It's just a fork from the postmaster, cribbed mostly from the stat collector > code. This will not get you very far, because the stat collector is not a real backe

[HACKERS] Coding help

2002-08-15 Thread Matthew T. O'Connor
Hello, I'm playing with creating an auto vacuum daemon, but it is my first time inside the pg source code and I'm a bit lost. I have gotten as far as having a vacuum daemon created on postmaster startup. It's just a fork from the postmaster, cribbed mostly from the stat collector code. Insi