Postgres 11
show timezone;
This gives me different values
- when I run it from DBeaver (shows America/New_York) vs.
- when I run it from PG Admin (shows UTC)
I run DBeaver and PG Admin from the same client machine.
I thought this was supposed to show me the server timezone.
Same for clock_timestamp() - I get different values.
Is this somehow related to the client OS timezone?
Or to some connection settings?
We're using an AWS RDS PostgreSQL instance which
is configured (as I checked) in UTC timezone.
What is the explanation?
I am really puzzled.
timezone is the timezone of the database session, not of the server.
It looks like DBeaver sets the parameter, while pgAdmin leaves it at its default value (whatever is configured on the server).
You can set the PGTZ environment variable to specify your desired PostgreSQL database session time zone.
Related
I have an SQL database connected to an Azure server, the timezone is set to UTC and the location is set to UK south, when I run the CURRENT_TIMESTAMP command on the SQL database it returns a time at UTC-1:00. I assume this is an Azure based issue since when I run the same command on a locally hosted SQL server I get the correct timezone. Any advice on the matter would be greatly appreciated. All I can think is the location being set to UK south assumes I'm in some overseas UK territory hence giving the wrong timezone so my next step is to make a new database on azure to host it but change the location since you cant change it once it has been created.
This is the query on the azure server
This is the query on my local server. Both of these queries were made at 17:43 UTC
Here is the sample procedure to get CURRENT_TIMESTAMP in AZURE SQL DATABASE.
Creating MySql server with the UK south location according to the the timezone is set to UTC.
Currently, the default time zone on Azure SQL DB is UTC. Unfortunately, there is not possible to change by server configuration or database configuration.
Azure SQL Database does not support time zone settings; it always follows UTC.
Use AT TIME ZONE in SQL Database if you need to interpret date and time information in a non-UTC time zone.
I am using presto ODBC to fetch data from Hive into one of the BI tools, however, the query fails with the below error. Could you please help me to understand what might be the issue.
ODBC version: Simba Presto ODBC Driver 1.02.09.1009
used sql : select created_ts from stg_tables.vend
Jul 07 08:07:03.919 ERROR 500 Statement::SQLPrepareW: [Simba][Presto] (1070) Unknown Presto data type: timestamp(3)
While if I am using below SQL it goes good.
select to_iso8601(created_ts AT TIME ZONE 'UTC') from stg_tables.ven
Recent versions of Presto added support for variable precision timestamp types. Unfortunately, Simba's ODBC driver makes certain assumptions about how the type names are presented to the client and fails with the new types.
The next release of Presto (coming out this week) will have a configuration option to restore the old behavior while we give client implementations a chance to upgrade their implementations if they made similar assumptions.
Update: this should now fixed in version 338. You can set the deprecated.omit-datetime-type-precision config option to true to restore the old behavior.
I have SQL job and i want to change the time zone to a different time zone
Assuming you're asking about a schedule on a SQL Server Agent job, SQL Server Agent uses the timezone of the host machine. You have to either change the timezone of the host machine that the SQL Server instance is running on or manually make the adjustment in the job schedule.
I am using Hyperion Reporting Studio. I have a report where I want to calculate the turn around time for messages that come in to my department.
I need to find a way, whether it's custom SQL or just a feature for the report to always pull the data from the prior day. I have an Open_Date filter where the setting is > 06/06/16 12:00 AM.
However I will always need the date to be the day prior to the current one. I will be using EPM which allows you to setup recurring reports, that run then get emailed to you on a daily basis, automatically. I need to figure out some custom SQL Hyperion can use in my date field and have not found any solutions.
Additional info: Using Hyperion Interactive Reporting Studio; DB2 and Oracle Databases.
It depends on your backend (DB2 or Oracle) which syntax you use. Also, do you want "yesterday" relative to the user, or to the server? Assuming the latter, because this sounds like a job on the server.
I think what you're looking for is:
CURRENT DATE for DB2 and
SYSDATE for Oracle
These are the equivalent of "today" relative to the server's date and time. Will the job run after midnight? It might be as simple as adding -1 but you could run into trouble if the job runs before midnight sometimes, and after midnight other times (don't know what would happen if the job ran through midnight).
I have an external content type in SharePoint 2010 pulling data from a SQL 2008R2 DB using BCS. All the data comes back fine but the Time stamp column is off by 2 hours when I compare the values displayed in the Read List with the values returned when I query the DB in Management Studio. I've attached a picture with an example:
The times displayed in the browser are 4 hours earlier than the Time stamp returned by Management Studio. I've checked the Date and Time settings on both the client and server and they are fine. Any ideas what could cause this?
Check the normalisation settings for your BDC.
Make sure you set it like this:
<TypeDescriptor TypeName="System.DateTime"
Name="YourDate" DefaultDisplayName="Your Date">
<Interpretation>
<NormalizeDateTime LobDateTimeMode="Local" />
</Interpretation>
</TypeDescriptor>
http://www.shillier.com/archive/2010/09/01/why-are-my-date-fields-wrong-in-business-connectivity-servces.aspx
External Systems created through BCS use UTC as the time zone by default. Your SQl database inherits the time zone settings from Windows so crosscheck the server settings with you External Content Type properties and also your front-end SharePoint settings. Depending on you settings, if your user profile has a specified time zone, the time is converted from UTC to the user's time zone. If the time zone has not been specified (default) the time zone of the site on which the External Data is hosted is used.