表名可以在Redshift中以整数开头

时间:2022-12-25 23:06:35

I have a customer trying to create a table name starting with a number followed by alphabet ( example: 1234-testtable ) and the redshift is throwing

我有一个客户试图创建一个以数字后跟字母表开头的表名(例如:1234-testtable),并且redshift正在抛出

ERROR: syntax error at or near "1234" Position:53   

Can't we create a table name starting with number in Amazon Redshift ?

我们不能在Amazon Redshift中创建以数字开头的表名吗?

1 个解决方案

#1


0  

According to the Names and Identifiers documentation, you cannot start your identifier with a letter and it cannot contain a hyphen as only ASCII letters, digits, underscore characters (_), or dollar signs ($) are valid characters. The complete set rules for Redshift is:

根据名称和标识符文档,您无法使用字母开始标识符,并且不能包含连字符,因为只有ASCII字母,数字,下划线字符(_)或美元符号($)才是有效字符。 Redshift的完整规则是:

  • Contain only ASCII letters, digits, underscore characters (_), or dollar signs ($).
  • 仅包含ASCII字母,数字,下划线字符(_)或美元符号($)。
  • Begin with an alphabetic character or underscore character.
  • 以字母字符或下划线字符开头。
  • Subsequent characters may include letters, digits, underscores, or dollar signs.
  • 后续字符可以包括字母,数字,下划线或美元符号。
  • Be between 1 and 127 characters in length, not including quotes for delimited identifiers.
  • 长度介于1到127个字符之间,不包括分隔标识符的引号。
  • Contain no quotation marks and no spaces. Not be a reserved SQL key word.
  • 不包含引号,也不包含空格。不是保留的SQL关键字。

Thus you could elect for a name like testtable_1234 instead.

因此,您可以选择像testtable_1234这样的名称。

#1


0  

According to the Names and Identifiers documentation, you cannot start your identifier with a letter and it cannot contain a hyphen as only ASCII letters, digits, underscore characters (_), or dollar signs ($) are valid characters. The complete set rules for Redshift is:

根据名称和标识符文档,您无法使用字母开始标识符,并且不能包含连字符,因为只有ASCII字母,数字,下划线字符(_)或美元符号($)才是有效字符。 Redshift的完整规则是:

  • Contain only ASCII letters, digits, underscore characters (_), or dollar signs ($).
  • 仅包含ASCII字母,数字,下划线字符(_)或美元符号($)。
  • Begin with an alphabetic character or underscore character.
  • 以字母字符或下划线字符开头。
  • Subsequent characters may include letters, digits, underscores, or dollar signs.
  • 后续字符可以包括字母,数字,下划线或美元符号。
  • Be between 1 and 127 characters in length, not including quotes for delimited identifiers.
  • 长度介于1到127个字符之间,不包括分隔标识符的引号。
  • Contain no quotation marks and no spaces. Not be a reserved SQL key word.
  • 不包含引号,也不包含空格。不是保留的SQL关键字。

Thus you could elect for a name like testtable_1234 instead.

因此,您可以选择像testtable_1234这样的名称。