Re: [HACKERS] Hacking gram.y Error syntax error at or near MERGEJOIN

2011-06-03 Thread HuangQi
Thanks all for your ideas. Though wired, I reinstalled the Postgres and
tried again. This error message disappears. The parser now works good.

On 3 June 2011 01:13, Alvaro Herrera alvhe...@commandprompt.com wrote:

 Excerpts from HuangQi's message of jue jun 02 11:17:21 -0400 2011:
  Hi, thanks a lot for your ideas. But I've done all these things. I've
  checked the gram.y and kwlist.h files many times but can not find what's
  wrong. So is there any possibility that the problem comes from something
  after parser, though it seems it should comes from parser?

 If you want more input, post the patch.

 --
 Álvaro Herrera alvhe...@commandprompt.com
 The PostgreSQL Company - Command Prompt, Inc.
 PostgreSQL Replication, Consulting, Custom Development, 24x7 support




-- 
Best Regards
Huang Qi Victor


[HACKERS] Hacking gram.y Error syntax error at or near MERGEJOIN

2011-06-02 Thread HuangQi
Hi,
I'm doing a hacking project which hacks the gram.y file and some other
so that postgres can execute some query plan language to run a particular
plan. I did some modifications and try run it. It compiled and installed
successfully. But when I was trying to run a MergeJoin operation with
keyword MERGEJOIN, it says ERROR: syntax error at or near 'MERGEJOIN'. It
seems postgres didn't recognize this keyword. Is it caused by any error
inside gram.y? Or how can I trace this error?

-- 
Best Regards
Huang Qi Victor


Re: [HACKERS] Hacking gram.y Error syntax error at or near MERGEJOIN

2011-06-02 Thread Pavel Stehule
Hello

you should to add new keywords to
postgresql/src/include/parser/kwlist.h (depends on pg version)

attention - keywords must be in alphabet order

Regards

Pavel Stehule

2011/6/2 HuangQi huangq...@gmail.com:
 Hi,
     I'm doing a hacking project which hacks the gram.y file and some other
 so that postgres can execute some query plan language to run a particular
 plan. I did some modifications and try run it. It compiled and installed
 successfully. But when I was trying to run a MergeJoin operation with
 keyword MERGEJOIN, it says ERROR: syntax error at or near 'MERGEJOIN'. It
 seems postgres didn't recognize this keyword. Is it caused by any error
 inside gram.y? Or how can I trace this error?

 --
 Best Regards
 Huang Qi Victor


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


Re: [HACKERS] Hacking gram.y Error syntax error at or near MERGEJOIN

2011-06-02 Thread HuangQi
Yes, I've also added mergejoin to kwlist.h as unreserved_keyword. In order
to build AST, I also keep a new node struct in planoperators.h and a new
node tag inside nodes.h.

On 2 June 2011 15:49, Pavel Stehule pavel.steh...@gmail.com wrote:

 Hello

 you should to add new keywords to
 postgresql/src/include/parser/kwlist.h (depends on pg version)

 attention - keywords must be in alphabet order

 Regards

 Pavel Stehule

 2011/6/2 HuangQi huangq...@gmail.com:
  Hi,
  I'm doing a hacking project which hacks the gram.y file and some
 other
  so that postgres can execute some query plan language to run a particular
  plan. I did some modifications and try run it. It compiled and installed
  successfully. But when I was trying to run a MergeJoin operation with
  keyword MERGEJOIN, it says ERROR: syntax error at or near 'MERGEJOIN'.
 It
  seems postgres didn't recognize this keyword. Is it caused by any error
  inside gram.y? Or how can I trace this error?
 
  --
  Best Regards
  Huang Qi Victor
 




-- 
Best Regards
Huang Qi Victor


Re: [HACKERS] Hacking gram.y Error syntax error at or near MERGEJOIN

2011-06-02 Thread Pavel Stehule
Hello

2011/6/2 HuangQi huangq...@gmail.com:
 Yes, I've also added mergejoin to kwlist.h as unreserved_keyword. In order
 to build AST, I also keep a new node struct in planoperators.h and a new
 node tag inside nodes.h.


then recheck alphabet order of keywords, else recheck bison rules.

Pavel


 On 2 June 2011 15:49, Pavel Stehule pavel.steh...@gmail.com wrote:

 Hello

 you should to add new keywords to
 postgresql/src/include/parser/kwlist.h (depends on pg version)

 attention - keywords must be in alphabet order

 Regards

 Pavel Stehule

 2011/6/2 HuangQi huangq...@gmail.com:
  Hi,
      I'm doing a hacking project which hacks the gram.y file and some
  other
  so that postgres can execute some query plan language to run a
  particular
  plan. I did some modifications and try run it. It compiled and installed
  successfully. But when I was trying to run a MergeJoin operation with
  keyword MERGEJOIN, it says ERROR: syntax error at or near 'MERGEJOIN'.
  It
  seems postgres didn't recognize this keyword. Is it caused by any error
  inside gram.y? Or how can I trace this error?
 
  --
  Best Regards
  Huang Qi Victor
 



 --
 Best Regards
 Huang Qi Victor


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


Re: [HACKERS] Hacking gram.y Error syntax error at or near MERGEJOIN

2011-06-02 Thread Andrew Dunstan



On 06/02/2011 03:28 AM, HuangQi wrote:

Hi,
I'm doing a hacking project which hacks the gram.y file and some 
other so that postgres can execute some query plan language to run a 
particular plan. I did some modifications and try run it. It compiled 
and installed successfully. But when I was trying to run a MergeJoin 
operation with keyword MERGEJOIN, it says ERROR: syntax error at or 
near 'MERGEJOIN'. It seems postgres didn't recognize this keyword. Is 
it caused by any error inside gram.y? Or how can I trace this error?





Without seeing your grammar changes and the statement you're trying to 
execute it's pretty much impossible to tell.


cheers

andrew

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


Re: [HACKERS] Hacking gram.y Error syntax error at or near MERGEJOIN

2011-06-02 Thread Heikki Linnakangas

On 02.06.2011 15:16, Andrew Dunstan wrote:

On 06/02/2011 03:28 AM, HuangQi wrote:

Hi,
I'm doing a hacking project which hacks the gram.y file and some other
so that postgres can execute some query plan language to run a
particular plan. I did some modifications and try run it. It compiled
and installed successfully. But when I was trying to run a MergeJoin
operation with keyword MERGEJOIN, it says ERROR: syntax error at or
near 'MERGEJOIN'. It seems postgres didn't recognize this keyword. Is
it caused by any error inside gram.y? Or how can I trace this error?


Without seeing your grammar changes and the statement you're trying to
execute it's pretty much impossible to tell.


Yeah. One more guess is that you didn't include the keyword in the 
keyword list at the end of gram.y. There's script to check various 
keyword-related things at src/tools/check_keywords.pl


--
  Heikki Linnakangas
  EnterpriseDB   http://www.enterprisedb.com

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


Re: [HACKERS] Hacking gram.y Error syntax error at or near MERGEJOIN

2011-06-02 Thread HuangQi
Hi, thanks a lot for your ideas. But I've done all these things. I've
checked the gram.y and kwlist.h files many times but can not find what's
wrong. So is there any possibility that the problem comes from something
after parser, though it seems it should comes from parser?

On 2 June 2011 21:14, Heikki Linnakangas 
heikki.linnakan...@enterprisedb.com wrote:

 On 02.06.2011 15:16, Andrew Dunstan wrote:

 On 06/02/2011 03:28 AM, HuangQi wrote:

 Hi,
 I'm doing a hacking project which hacks the gram.y file and some other
 so that postgres can execute some query plan language to run a
 particular plan. I did some modifications and try run it. It compiled
 and installed successfully. But when I was trying to run a MergeJoin
 operation with keyword MERGEJOIN, it says ERROR: syntax error at or
 near 'MERGEJOIN'. It seems postgres didn't recognize this keyword. Is
 it caused by any error inside gram.y? Or how can I trace this error?


 Without seeing your grammar changes and the statement you're trying to
 execute it's pretty much impossible to tell.


 Yeah. One more guess is that you didn't include the keyword in the keyword
 list at the end of gram.y. There's script to check various keyword-related
 things at src/tools/check_keywords.pl

 --
  Heikki Linnakangas
  EnterpriseDB   http://www.enterprisedb.com




-- 
Best Regards
Huang Qi Victor


Re: [HACKERS] Hacking gram.y Error syntax error at or near MERGEJOIN

2011-06-02 Thread Alvaro Herrera
Excerpts from HuangQi's message of jue jun 02 11:17:21 -0400 2011:
 Hi, thanks a lot for your ideas. But I've done all these things. I've
 checked the gram.y and kwlist.h files many times but can not find what's
 wrong. So is there any possibility that the problem comes from something
 after parser, though it seems it should comes from parser?

If you want more input, post the patch.

-- 
Álvaro Herrera alvhe...@commandprompt.com
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

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


Re: [HACKERS] Hacking gram.y Error syntax error at or near MERGEJOIN

2011-06-02 Thread Robert Haas
On Thu, Jun 2, 2011 at 11:17 AM, HuangQi huangq...@gmail.com wrote:
 Hi, thanks a lot for your ideas. But I've done all these things. I've
 checked the gram.y and kwlist.h files many times but can not find what's
 wrong. So is there any possibility that the problem comes from something
 after parser, though it seems it should comes from parser?

It seems very unlikely, but you could probably find out the answer
yourself by using a debugger.  Set a breakpoint on errfinish and see
where the error gets thrown from.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

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