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 retrieve data from PostgreSQL for yesterday's date?
- How can I troubleshoot zero damaged pages in PostgreSQL?
- How can I use PostgreSQL with YAML?
- How do I use PostgreSQL's XMIN and XMAX features?
- How do I use PostgreSQL's XMLTABLE to parse XML data?
- How do I store binary data in a Postgresql database using the bytea data type?
- How can I monitor PostgreSQL performance using Zabbix?
- How do I use PostgreSQL ZonedDateTime to store date and time information?
- How can I use PostgreSQL on the Yandex Cloud platform?
- How do I set the PostgreSQL work_mem parameter?
See more codes...