13

I know that to create a column in mysql is like this

 'date' timestamp not null default CURRENT_TIMESTAMP, 

  how to postgresql?

3
  • 1
    What did you try so far? And what error message did you get, if you got one... Commented May 7, 2014 at 13:01
  • 1
    Apart from the invalid identifier for the column name, that looks OK to me. Commented May 7, 2014 at 13:04
  • 1
    To clarify, 'single quotes' represent a literal string; to quote an identifier, you need "double quotes": "date" timestamp not null default CURRENT_TIMESTAMP (or give your column a non-reserved name). Commented May 7, 2014 at 13:36

1 Answer 1

24

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.