zoukankan      html  css  js  c++  java
  • postgreSQL使用杂谈

    由于当时是在美国安装的postgreSQL ,导致回到上海后使用时,发现时间数据显示不正确。

    To acomplish the timezone change in Postgres 9.6 you must:

    (1)查看当前timezone:

      show timezone;

    或者在pgAdmin 4上查看:

     The time zone is a session parameter. So, you can change the timezone for the current session.

    set timezone TO 'Asia/Shanghai';

    Note: 'set timezone To ..' only sets the timezone for the current session and if you change the timezone configuration parameter in Postgresql.conf it should change the timezone for all databases.

    Choose a timezone from:

    SELECT * FROM pg_timezone_names;

    Search for the closest location to your zone and set example:

    ALTER DATABASE postgres SET timezone TO 'Asia/Shanghai';

    Use your DB name.

     (2)Uncomment the "timezone" line in your postgresql.conf file and put your timezone as shown:

    (3)Restart Postgres 或者Tools>Reload Configuration (then refresh)

    参考:https://stackoverflow.com/questions/6663765/postgres-default-timezone

  • 相关阅读:
    ACM_“IP地址”普及(进制转换)
    goj 堆箱子咯(栈)
    ACM_夏天到了,又到了出游的季节
    ACM_迟到的祝福(四)
    ACM_梦中的函数
    ACM_ZHANGZHANG喜欢手表
    ACM_出题人这样不好吧
    ACM_Mystery
    ACM_Repeating Characters
    P1160 队列安排 luogu洛谷
  • 原文地址:https://www.cnblogs.com/carsonzhu/p/7797907.html
Copyright © 2011-2022 走看看