Repository: tobymao/sqlglot

Issue:
[BUG]In PostgreSQL, int8 represents the 64-bit integer type, not tinyint
**Fully reproducible code snippet**
```python3
import sqlglot

if __name__ == '__main__':
    sql = """create table a_table
        (
            column_id      int8 not null constraint a_table_pk primary key,
            column_2       date,
            column_3       varchar(2000),
            column_4       int2,
            column_5       int4
        );
    """
    expressions = sqlglot.parse(sql, dialect="postgres")
    expression = expressions[0]
    print(expression.sql())
```

output

```txt
CREATE TABLE a_table (column_id **TINYINT** NOT NULL CONSTRAINT a_table_pk PRIMARY KEY, column_2 DATE, column_3 VARCHAR(2000), column_4 SMALLINT, column_5 INT)
```
"int8" being mistranslated as "tinyint"

**Official Documentation**

postgresql 10 official document: [https://www.postgresql.org/docs/10/datatype.html#DATATYPE-TABLE](https://www.postgresql.org/docs/10/datatype.html#DATATYPE-TABLE)


Discussion:

Patch:
diff --git a/sqlglot/dialects/postgres.py b/sqlglot/dialects/postgres.py
index 085063da..770dad2f 100644
--- a/sqlglot/dialects/postgres.py
+++ b/sqlglot/dialects/postgres.py
@@ -266,24 +266,25 @@ class Postgres(Dialect):
             "BIGSERIAL": TokenType.BIGSERIAL,
             "CHARACTER VARYING": TokenType.VARCHAR,
             "CONSTRAINT TRIGGER": TokenType.COMMAND,
+            "CSTRING": TokenType.PSEUDO_TYPE,
             "DECLARE": TokenType.COMMAND,
             "DO": TokenType.COMMAND,
             "EXEC": TokenType.COMMAND,
             "HSTORE": TokenType.HSTORE,
+            "INT8": TokenType.BIGINT,
             "JSONB": TokenType.JSONB,
             "MONEY": TokenType.MONEY,
+            "NAME": TokenType.NAME,
+            "OID": TokenType.OBJECT_IDENTIFIER,
+            "ONLY": TokenType.ONLY,
+            "OPERATOR": TokenType.OPERATOR,
             "REFRESH": TokenType.COMMAND,
             "REINDEX": TokenType.COMMAND,
             "RESET": TokenType.COMMAND,
             "REVOKE": TokenType.COMMAND,
             "SERIAL": TokenType.SERIAL,
             "SMALLSERIAL": TokenType.SMALLSERIAL,
-            "NAME": TokenType.NAME,
             "TEMP": TokenType.TEMPORARY,
-            "CSTRING": TokenType.PSEUDO_TYPE,
-            "OID": TokenType.OBJECT_IDENTIFIER,
-            "ONLY": TokenType.ONLY,
-            "OPERATOR": TokenType.OPERATOR,
             "REGCLASS": TokenType.OBJECT_IDENTIFIER,
             "REGCOLLATION": TokenType.OBJECT_IDENTIFIER,
             "REGCONFIG": TokenType.OBJECT_IDENTIFIER,


Test patch:
diff --git a/tests/dialects/test_postgres.py b/tests/dialects/test_postgres.py
index 85701025..7cfba94a 100644
--- a/tests/dialects/test_postgres.py
+++ b/tests/dialects/test_postgres.py
@@ -320,6 +320,10 @@ class TestPostgres(Validator):
             "SELECT SUBSTRING('afafa' for 1)",
             "SELECT SUBSTRING('afafa' FROM 1 FOR 1)",
         )
+        self.validate_identity(
+            "CAST(x AS INT8)",
+            "CAST(x AS BIGINT)",
+        )
 
         self.validate_all(
             "CREATE TABLE t (c INT)",