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_examplewith a single column namedidof typeBIGINT. -
INSERT INTO bigint_example (id) VALUES (9223372036854775807);- This inserts the value9223372036854775807into theidcolumn of thebigint_exampletable.
Helpful links
More of Postgresql
- How do I use PostgreSQL's XMLTABLE to parse XML data?
- How can I retrieve data from PostgreSQL for yesterday's date?
- How do I use PostgreSQL's XMIN and XMAX features?
- How do I use the PostgreSQL quote_ident function?
- How do I round a number in PostgreSQL?
- How do I use the PostgreSQL NVL function?
- How do I use PostgreSQL with Qt?
- How can I use PostgreSQL XOR to compare two values?
- How do I use the WITH statement in PostgreSQL?
- How can I decide between PostgreSQL and MySQL for my software development project?
See more codes...