postgresqlHow do I store a bigint value in a PostgreSQL database?
To store a bigint value in a PostgreSQL database, you can use the BIGINT
data type. This data type stores a signed 8-byte integer value.
For example, the following code block creates a table with a BIGINT
column and inserts a value:
CREATE TABLE bigint_example (
id BIGINT
);
INSERT INTO bigint_example (id) VALUES (9223372036854775807);
The output of the above code block would be:
INSERT 0 1
Code explanation
-
CREATE TABLE bigint_example (id BIGINT);
- This creates a table namedbigint_example
with a single column namedid
of typeBIGINT
. -
INSERT INTO bigint_example (id) VALUES (9223372036854775807);
- This inserts the value9223372036854775807
into theid
column of thebigint_example
table.
Helpful links
More of Postgresql
- How can I troubleshoot zero damaged pages in PostgreSQL?
- How do I use PostgreSQL ZonedDateTime to store date and time information?
- How do I set the PostgreSQL work_mem parameter?
- How can I use PostgreSQL with YAML?
- How can I retrieve data from PostgreSQL for yesterday's date?
- How do I install PostgreSQL and Zabbix on my system?
- How do I install and configure PostgreSQL on Ubuntu?
- How do I rename a table in PostgreSQL?
- How can I write a PostgreSQL query to retrieve JSON data?
- How can Zalando use PostgreSQL to improve its software development?
See more codes...