Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

connect to PGSQL 10.6. but error with Timezone class #19

Closed
onionmixer opened this issue Mar 18, 2019 · 5 comments
Closed

connect to PGSQL 10.6. but error with Timezone class #19

onionmixer opened this issue Mar 18, 2019 · 5 comments

Comments

@onionmixer
Copy link

server : postgresql 10.6 with gentoo linux
pharo : pharo 7.0

test code :

(P3Client new url: 'psql://frontend:8231frontend@192.168.1.240:5432/pegarelease') in: [ :client |
   [ client query: 'SELECT * FROM system_countries' ] ensure: [ client close ] ].

but encounterd this error...

readTimezoneWithId : [ ^ self error: 'Unknown Timezone ID: ' , id asString ]

id Value is "ROK". how to solve this?

@svenvc
Copy link
Owner

svenvc commented Mar 18, 2019

Hmm, ROK seems to be a deprecated abbreviation for Asia/Seoul. ZTimezone does understand all modern timezone designations (the long ones in /etc/share/zonetab) but only a few abbreviations.

Could you declare/configure your database to use Asia/Seoul as timezone ?

The problem is that P3Client tries to automatically adapt to the timezone used by the database.

You can have a look at P3ClientTest>>#testTimezone where there are some experiments with changing the connection's time zone.

Maybe I should extend https://github.com/svenvc/ztimestamp to undestand all abbreviations that occur in /etc/share/zonetab - I have to think about that.

@onionmixer
Copy link
Author

  1. I did not use "ROK" intentionally. Of course, we made the basic settings in linux environment with "Asia/Seoul".
  2. At the linux console, we confirmed that the zone command differs from the zoneinfo file of "ROK" and "Asia/Seoul".
  3. I do not know how to switch separately because I did not use "ROK" deliberately at this point.

I guess. Even if I set it to "Asia/Seoul" on linux system, "ROK" is returned. Is there a way to tell if this is a problem with ZTimestamp or a feature of the linux system?

@svenvc
Copy link
Owner

svenvc commented Apr 8, 2019

Hi,

I extended ZTimestamp's ZTimezone to support less common IDs like ROK (in addition to the modern Asia/Seoul variant). Could you try by loading the latest master version from https://github.com/svenvc/ztimestamp please ?

BTW, this might be helpful too https://phili.pe/posts/timestamps-and-time-zones-in-postgresql/

It might also be useful to give P3Client an option to better manage P3Client>>#initializeConverter and P3Converter>>#initializeFrom: when unknown values are encountered. I will look into that too.

Sven

@svenvc
Copy link
Owner

svenvc commented Jun 1, 2019

I will close this issue soon as fixed, as it should work from my POV.

@svenvc
Copy link
Owner

svenvc commented Jun 1, 2019

svenvc/ztimestamp@1a139e5

See #testROK

@svenvc svenvc closed this as completed Jun 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants