mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Implement SQL99 CREATE CAST and DROP CAST statements.
Also implement alternative forms to expose the PostgreSQL CREATE FUNCTION features. Implement syntax for READ ONLY and READ WRITE clauses in SET TRANSACTION. READ WRITE is already implemented (of course). Implement syntax for "LIKE table" clause in CREATE TABLE. Should be fairly easy to complete since it resembles SELECT INTO. Implement MATCH SIMPLE clause for foreign key definitions. This is explicit SQL99 syntax for the default behavior, so we now support it :) Start implementation of shorthand for national character literals in scanner. For now, just swallow the leading "N", but sometime soon let's figure out how to pass leading type info from the scanner to the parser. We should use the same technique for binary and hex bit string literals, though it might be unusual to have two apparently independent literal types fold into the same storage type.
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.96 2002/06/20 20:29:33 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.97 2002/06/22 02:04:45 thomas Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -107,8 +107,8 @@ unsigned char unescape_single_char(unsigned char c);
|
||||
|
||||
/* Bit string
|
||||
*/
|
||||
xbstart [bB]{quote}
|
||||
xbstop {quote}
|
||||
xbstart [bB]{quote}
|
||||
xbstop {quote}
|
||||
xbinside [^']*
|
||||
xbcat {quote}{whitespace_with_newline}{quote}
|
||||
|
||||
@@ -119,6 +119,10 @@ xhstop {quote}
|
||||
xhinside [^']+
|
||||
xhcat {quote}{whitespace_with_newline}{quote}
|
||||
|
||||
/* National character
|
||||
*/
|
||||
xnstart [nN]{quote}
|
||||
|
||||
/* Extended quote
|
||||
* xqdouble implements SQL92 embedded quote
|
||||
* xqcat allows strings to cross input lines
|
||||
@@ -286,6 +290,10 @@ other .
|
||||
<xc><<EOF>> { yyerror("unterminated /* comment"); }
|
||||
|
||||
{xbstart} {
|
||||
/* Binary bit type.
|
||||
* Should be passing the type forward into the parser
|
||||
* rather than trying to embed it into the string.
|
||||
*/
|
||||
token_start = yytext;
|
||||
BEGIN(xb);
|
||||
startlit();
|
||||
@@ -309,6 +317,10 @@ other .
|
||||
<xb><<EOF>> { yyerror("unterminated bit string literal"); }
|
||||
|
||||
{xhstart} {
|
||||
/* Hexadecimal bit type.
|
||||
* Should be passing the type forward into the parser
|
||||
* rather than trying to embed it into the string.
|
||||
*/
|
||||
token_start = yytext;
|
||||
BEGIN(xh);
|
||||
startlit();
|
||||
@@ -332,6 +344,17 @@ other .
|
||||
}
|
||||
<xh><<EOF>> { yyerror("unterminated hexadecimal integer"); }
|
||||
|
||||
{xnstart} {
|
||||
/* National character.
|
||||
* Need to remember type info to flow it forward into the parser.
|
||||
* Not yet implemented. - thomas 2002-06-17
|
||||
*/
|
||||
token_start = yytext;
|
||||
BEGIN(xq);
|
||||
startlit();
|
||||
}
|
||||
|
||||
|
||||
{xqstart} {
|
||||
token_start = yytext;
|
||||
BEGIN(xq);
|
||||
|
Reference in New Issue
Block a user