Hello,

 I'am trying CVS snapshor of postgres and on web page (new features of
postgres 6.5) is:

[...]
   New LOCK TABLE IN ... MODE(Vadim)
[...]

  I'am using similar statement on Oracle. But postgres doesn't accept
keyword 'IN'. 

Example:

=> lock table t row share mode;
LOCK TABLE
 ... this works

but:

=> lock table t IN row share mode;
ERROR:  parser: parse error at or near "in"
  .... but this not

It is mistake in grammar, or is there all OK ?

                                        thanks,

                                                David

-- 
* David Sauer, student of Czech Technical University
* electronic mail: davids@orfinet.cz (mime compatible)

15 May 1999 14:43:07 +0200
David Sauer <davids@orfinet.cz>
Syntax of LOCK TABLE ...
> Hello,
> 
>  I'am trying CVS snapshor of postgres and on web page (new features of
> postgres 6.5) is:
> 
> [...]
>    New LOCK TABLE IN ... MODE(Vadim)
> [...]
> 
>   I'am using similar statement on Oracle. But postgres doesn't accept
> keyword 'IN'. 
> 
> Example:
> 
> => lock table t row share mode;
> LOCK TABLE
>  ... this works
> 
> but:
> 
> => lock table t IN row share mode;
> ERROR:  parser: parse error at or near "in"
>   .... but this not
> 
> It is mistake in grammar, or is there all OK ?

Works here:

	test=> lock table pg_class IN row share mode;
	LOCK TABLE

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Sat, 15 May 1999 14:26:18 -0400 (EDT)
Bruce Momjian <maillist@candle.pha.pa.us>
Re: [HACKERS] Syntax of LOCK TABLE ...
David Sauer <davids@orfinet.cz> writes:
> => lock table t row share mode;
> LOCK TABLE
>  ... this works
> but:
> => lock table t IN row share mode;
> ERROR:  parser: parse error at or near "in"
>   .... but this not

> It is mistake in grammar, or is there all OK ?

I see this behavior too, and a quick look at gram.y shows that indeed
it is not expecting IN in a LOCK statement.  I do not know whether the
standard permits (or requires?) the IN keyword, so I don't know whether
to make the change...

			regards, tom lane

Sun, 16 May 1999 12:05:19 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] Syntax of LOCK TABLE ... 
Tom Lane wrote:
> 
> David Sauer <davids@orfinet.cz> writes:
> > => lock table t row share mode;
> > LOCK TABLE
> >  ... this works
> > but:
> > => lock table t IN row share mode;
> > ERROR:  parser: parse error at or near "in"
> >   .... but this not
> 
> > It is mistake in grammar, or is there all OK ?
> 
> I see this behavior too, and a quick look at gram.y shows that indeed
> it is not expecting IN in a LOCK statement.  I do not know whether the
> standard permits (or requires?) the IN keyword, so I don't know whether
> to make the change...

IN is required...

Vadim

Mon, 17 May 1999 00:14:17 +0800
Vadim Mikheev <vadim@krasnet.ru>
Re: [HACKERS] Syntax of LOCK TABLE ...
> Tom Lane wrote:
> > 
> > David Sauer <davids@orfinet.cz> writes:
> > > => lock table t row share mode;
> > > LOCK TABLE
> > >  ... this works
> > > but:
> > > => lock table t IN row share mode;
> > > ERROR:  parser: parse error at or near "in"
> > >   .... but this not
> > 
> > > It is mistake in grammar, or is there all OK ?
> > 
> > I see this behavior too, and a quick look at gram.y shows that indeed
> > it is not expecting IN in a LOCK statement.  I do not know whether the
> > standard permits (or requires?) the IN keyword, so I don't know whether
> > to make the change...
> 
> IN is required...

I have modified the grammar to require IN.  Looks like someone cleaned
up the LOCK grammar options recently, but forgot the IN.

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Sun, 16 May 1999 20:22:19 -0400 (EDT)
Bruce Momjian <maillist@candle.pha.pa.us>
Re: [HACKERS] Syntax of LOCK TABLE ...
> I have modified the grammar to require IN.  Looks like someone cleaned
> up the LOCK grammar options recently, but forgot the IN.

'Twas me. I don't recall seeing IN in the first place, but the
original gram.y support code did not actually use the normal yacc
grammar, but rather read most fields as IDENTS and then did strcmp()'s
to build the parse tree. There were lots of hidden behaviors in that.

Sorry, and thanks for fixing it.

                         - Tom

-- 
Thomas Lockhart				lockhart@alumni.caltech.edu
South Pasadena, California

Mon, 17 May 1999 14:08:35 +0000
Thomas Lockhart <lockhart@alumni.caltech.edu>
Re: [HACKERS] Syntax of LOCK TABLE ...