I know that to create a column in mysql is like this
'date' timestamp not null default CURRENT_TIMESTAMP,
how to postgresql?
PostgreSQL timestamp example First, create a table that consists of both timestamp the timestamptz columns. Next, set the time zone of the database server to America/Los_Angeles . After that, query data from the timestamp and timestamptz columns. The query returns the same timestamp values as the inserted values.
PostgreSQL has the data types smallserial, serial and bigserial; these are not true types, but merely a notational convenience for creating unique identifier columns. These are similar to AUTO_INCREMENT property supported by some other databases.
To list down all tables columns on a specific table in the a PostgreSQL database using psql command-line, you can use \dS your_table_name.
It's the same, you just have to fix the identifier quoting to use SQL standard "identifer quoting"
:
"date" timestamp not null default CURRENT_TIMESTAMP,
but really, you should not use "date"
as an identifier.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With