Re: [HACKERS] insert throw error when year field len 4 for timestamptz datatype

2013-08-16 Thread Rushabh Lathia
On Thu, Aug 15, 2013 at 1:08 AM, Tom Lane t...@sss.pgh.pa.us wrote: Rushabh Lathia rushabh.lat...@gmail.com writes: PFA patch and share your input/suggestions. I think this needs review. Please add it to the next commitfest. Done. Here is latest patch with testcase added to regression.

[HACKERS] Chinese in Postgres

2013-08-16 Thread ciifrance...@tiscali.it
Hello all, before writing this message, I wrote about this in other mailing lists without solving my problem. Maybe some of you can help me. I have problems with a DB in postgres, when i try to insert Chinese strings in UTF-8 format. If I insert the data using a C++ program I have empty

Re: [HACKERS] Chinese in Postgres

2013-08-16 Thread Hannu Krosing
On 08/16/2013 01:25 PM, ciifrance...@tiscali.it wrote: Hello all, before writing this message, I wrote about this in other mailing lists without solving my problem. Maybe some of you can help me. I have problems with a DB in postgres, when i try to insert Chinese strings in UTF-8 format.

Re: R: Re: [HACKERS] Chinese in Postgres

2013-08-16 Thread Hannu Krosing
On 08/16/2013 02:40 PM, ciifrance...@tiscali.it wrote: Thanks for your answer. Yes, the client is also UTF8: MyDB=# show client_encoding; client_encoding - UTF8 (1 row) Strange, it works for me : hannu@hannu-900X3E:~/workspace/my-app$ psql psql (9.3beta2, server 9.2.4)

R: Re: [HACKERS] Chinese in Postgres

2013-08-16 Thread ciifrance...@tiscali.it
Thanks for your answer. Yes, the client is also UTF8: MyDB=# show client_encoding; client_encoding - UTF8 (1 row) Cheers Francesco Messaggio originale Da: ha...@2ndquadrant.com Data: 16/08/2013 14.16 A: ciifrance...@tiscali.it ciifrance...@tiscali.it Cc:

R: 回复: [pgsql-zh-general] R: Re: [HACKERS] Chinese in Postgres

2013-08-16 Thread ciifrance...@tiscali.it
[I reply to both in one email] Song: that C++ program has a log file. In the log file the queries look like this: UPDATE MY_table SET UTF8_field = 'e58fb0203132333427205748455245204944203d2031 starting from the first chinese letter, all the rest of the query is in hexa. But this is not a

Re: [HACKERS] LDAP: bugfix and deprecated OpenLDAP API

2013-08-16 Thread Magnus Hagander
On Tue, Jul 23, 2013 at 11:53 AM, Albe Laurenz laurenz.a...@wien.gv.at wrote: Magnus Hagander wrote: In that case, doesn't this patch break Windows? We no longer do the anonymous bind on Windows, since it's now in the #ifdef HAVE_LIBLDAP. Don't we need to keep the ldap_simple_bind() call in

[HACKERS] 回复: [pgsql-zh-general] R: Re: [HACKERS] Chinese in Postgres

2013-08-16 Thread Song
maybe your C++ program has something (such as charset or configuation) causing this strange thing mark 发件人: ciifrance...@tiscali.it ciifrance...@tiscali.it 收件人: ha...@2ndquadrant.com 抄送: pgsql-hackers@postgresql.org; pgsql-zh-gene...@postgresql.org;

Re: [HACKERS] Re: [PATCH] Re: [BUGS] BUG #7815: Upgrading PostgreSQL from 9.1 to 9.2 with pg_upgrade/postgreql-setup fails - invalid status retrieve

2013-08-16 Thread Bruce Momjian
On Mon, Aug 12, 2013 at 04:44:12PM -0400, Bruce Momjian wrote: On Mon, Aug 12, 2013 at 10:08:07PM +0200, Pavel Raiskup wrote: The patch moves the atexit setting up, as you suggested, but only does that when pg_ctl succeeds (we know we started the server), Yes, of course! PG 9.1+

Re: ALTER SYSTEM SET command to change postgresql.conf parameters (RE: [HACKERS] Proposal for Allow postgresql.conf values to be changed via SQL [review])

2013-08-16 Thread Robert Haas
On Fri, Aug 9, 2013 at 8:44 AM, Stephen Frost sfr...@snowman.net wrote: * Robert Haas (robertmh...@gmail.com) wrote: On Sun, Aug 4, 2013 at 4:26 PM, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: What I'm yet unsure about is that there's a consensus that the use cases are worthy of a new

Re: ALTER SYSTEM SET command to change postgresql.conf parameters (RE: [HACKERS] Proposal for Allow postgresql.conf values to be changed via SQL [review])

2013-08-16 Thread Alvaro Herrera
Robert Haas escribió: On Fri, Aug 9, 2013 at 8:44 AM, Stephen Frost sfr...@snowman.net wrote: A shared catalog which defined which *database* to run the trigger in, with a way to fire off a new backend worker in that database and tell it to run the trigger, might be interesting and would

Re: [HACKERS] Server crash when using bgw_main for a dynamic bgworker

2013-08-16 Thread Robert Haas
On Mon, Aug 12, 2013 at 1:26 AM, Michael Paquier michael.paqu...@gmail.com wrote: While playing a bit with background workers (commit 527ea66), I found that setting bgw_main for a dynamic bgworker, as well as bgw_library_name and bgw_library_name, crashes to server if the library defining the

Re: [HACKERS] [PATCH] pg_sleep(interval)

2013-08-16 Thread Robert Haas
On Thu, Aug 8, 2013 at 7:52 AM, Vik Fearing vik.fear...@dalibo.com wrote: Someone on IRC a while ago was complaining that there was no way to specify an interval for pg_sleep, so I made one. Patch against today's HEAD attached. Usage: SELECT pg_sleep(interval '2 minutes'); The problem with

Re: [HACKERS] Foreground vacuum and buffer access strategy

2013-08-16 Thread Robert Haas
On Tue, Aug 13, 2013 at 4:11 PM, Greg Stark st...@mit.edu wrote: I'm not convinced using a ring buffer is necessarily that bad even if you want to vacuum as fast as possible. The reason we use a small ring buffer is to avoid poisoning the entire cache with vacuum pages, not to throttle the

Re: [HACKERS] [PATCH] pg_sleep(interval)

2013-08-16 Thread Greg Stark
Except there are no data types that can be cast to both double and interval currently. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS] Regarding BGworkers

2013-08-16 Thread Robert Haas
On Wed, Aug 14, 2013 at 8:04 AM, Michael Paquier michael.paqu...@gmail.com wrote: On Wed, Aug 14, 2013 at 10:10 AM, Robert Haas robertmh...@gmail.com wrote: I think Alvaro's suggestion is better. It's shorter, and makes clear that at most one will be started. OK cool. Here are patches for 9.3

Re: [HACKERS] [PATCH] pg_sleep(interval)

2013-08-16 Thread Robert Haas
On Fri, Aug 16, 2013 at 2:57 PM, Greg Stark st...@mit.edu wrote: Except there are no data types that can be cast to both double and interval currently. That, unfortunately, is not sufficient to avoid a problem. rhaas=# create or replace function foo(double precision) returns double precision

Re: [HACKERS] pgstat_reset_remove_files ignores its argument

2013-08-16 Thread Robert Haas
On Wed, Aug 14, 2013 at 12:13 AM, Jeff Janes jeff.ja...@gmail.com wrote: in 9.3 and 9.4, pgstat_reset_remove_files uses the global variable pgstat_stat_directory rather than the argument it is passed, directory. On crash recovery, this means the tmp directory gets cleared twice and the

Re: [HACKERS] pgstat_reset_remove_files ignores its argument

2013-08-16 Thread Tomas Vondra
On 16.8.2013 21:38, Robert Haas wrote: On Wed, Aug 14, 2013 at 12:13 AM, Jeff Janes jeff.ja...@gmail.com wrote: in 9.3 and 9.4, pgstat_reset_remove_files uses the global variable pgstat_stat_directory rather than the argument it is passed, directory. On crash recovery, this means the tmp

Re: [HACKERS] [PATCH] pg_sleep(interval)

2013-08-16 Thread Peter Eisentraut
On 8/16/13 3:35 PM, Robert Haas wrote: On Fri, Aug 16, 2013 at 2:57 PM, Greg Stark st...@mit.edu wrote: Except there are no data types that can be cast to both double and interval currently. That, unfortunately, is not sufficient to avoid a problem. rhaas=# create or replace function

Re: [HACKERS] pg_ctl initdb takes options, but pg_ctl --help doesn't document them?

2013-08-16 Thread Peter Eisentraut
On 8/15/13 2:58 PM, Jon Nelson wrote: Taking a look at PostgreSQL HEAD today, I noticed that pg_ctl documents that pg_ctl initdb takes OPTIONS but doesn't document them (unlike for start and others). Is this intentional? The man page tells you that those are the options for regular initdb.

Re: [HACKERS] 9.4 regression

2013-08-16 Thread Bruce Momjian
On Thu, Aug 15, 2013 at 12:08:57PM -0500, Jon Nelson wrote: Where are we on this issue? I've been able to replicate it pretty easily with PostgreSQL and continue to look into it. I've contacted Theodore Ts'o and have gotten some useful information, however I'm unable to replicate the

Re: [HACKERS] [PATCH] pg_sleep(interval)

2013-08-16 Thread Tom Lane
Peter Eisentraut pete...@gmx.net writes: On 8/16/13 3:35 PM, Robert Haas wrote: On Fri, Aug 16, 2013 at 2:57 PM, Greg Stark st...@mit.edu wrote: Except there are no data types that can be cast to both double and interval currently. That, unfortunately, is not sufficient to avoid a problem.

[HACKERS] Fix Windows socket error checking for MinGW

2013-08-16 Thread Michael Cronenworth
I started a thread on the general list so read that for more info. http://www.postgresql.org/message-id/520a6e55.40...@cchtml.com I'm also going to submit the patch to CommitFest. Thanks, Michael From bb79da0013d5169b4530df28ece0c296004d1db4 Mon Sep 17 00:00:00 2001 From: Michael Cronenworth

Re: [HACKERS] [PATCH] pg_sleep(interval)

2013-08-16 Thread Josh Berkus
On 08/16/2013 04:52 PM, Tom Lane wrote: Since the same effect can be had by writing a user-defined SQL function, I'm a bit inclined to say that the value-added by having this as a built-in function doesn't justify the risk of breaking existing apps. It's a close call though, because both the

Re: [HACKERS] [PATCH] pg_sleep(interval)

2013-08-16 Thread Tom Lane
Josh Berkus j...@agliodbs.com writes: Why not just call it pg_sleep_int()? To me, that looks like something that would take an int. I suppose you could call it pg_sleep_interval(), but that's getting pretty verbose. The larger picture here though is that that's ugly as sin; it just flies in

Re: [HACKERS] [PATCH] pg_sleep(interval)

2013-08-16 Thread Josh Berkus
On 08/16/2013 05:15 PM, Tom Lane wrote: Josh Berkus j...@agliodbs.com writes: Why not just call it pg_sleep_int()? To me, that looks like something that would take an int. I suppose you could call it pg_sleep_interval(), but that's getting pretty verbose. The larger picture here though

Re: [HACKERS] Fix Windows socket error checking for MinGW

2013-08-16 Thread Noah Misch
On Fri, Aug 16, 2013 at 06:56:45PM -0500, Michael Cronenworth wrote: I started a thread on the general list so read that for more info. http://www.postgresql.org/message-id/520a6e55.40...@cchtml.com I'm also going to submit the patch to CommitFest. +#ifndef WIN32 if