Re: [GENERAL] Major upgrade of PostgreSQL and MySQL

2013-10-06 Thread Patrick Dung
Noted and thanks.

I can see that it should be updated in the devel manual page:
http://www.postgresql.org/docs/devel/static/pgupgrade.html


Thanks,
Patrick




 From: Bruce Momjian 
To: Patrick Dung  
Cc: Stephen Frost ; "pgsql-general@postgresql.org" 
; Ivan Voras ; Tom Lane 
 
Sent: Saturday, October 5, 2013 10:19 PM
Subject: Re: [GENERAL] Major upgrade of PostgreSQL and MySQL
 

On Sat, Sep 14, 2013 at 01:54:40AM +0800, Patrick Dung wrote:

> 1. In the past, I have an impression that it requires double of the database
> size.
> Because the manual present in a way that it 'must' need to hold the old and 
> new
> database cluster.
> But it does not mention the benefit of using hard links to save disk space and
> speed.
> I think the documentation could put a note at the beginning for new users.
> 
> 2. Also I think the documentation should provide more info for users that use
> packages.
> Most likely the system would do dependency checking and may refuse two install
> two versions at the same time.
> So uses need to install the new version in another location.
> More documentation should be provided for this part (e.g for users using Linux
> rpm/deb or FreeBSD ports).
> 
> 3. But the way, if users is using Windows, is the link option still works?

I have applied the attached documentation addition to mention that link
mode uses less disk space, and that junction points are used on Windows.
Backpatched to 9.3.

-- 
  Bruce Momjian          http://momjian.us
  EnterpriseDB                            http://enterprisedb.com

  + It's impossible for everything to be true. +

[GENERAL] C-language stored function and float4 type

2013-10-06 Thread whiplash

Hello! I have C-language stored function like this:

#include 
#include 

#ifdef PG_MODULE_MAGIC
PG_MODULE_MAGIC;
#endif

PG_FUNCTION_INFO_V1(testfunc);

Datum testfunc(PG_FUNCTION_ARGS)
{
float4 x = PG_GETARG_FLOAT4(0);
float4 y = PG_GETARG_FLOAT4(1);

PG_RETURN_FLOAT4(x + y);
}

CREATE FUNCTION testfunc ( x real, y real )
RETURNS real AS
'testfunc'
LANGUAGE C STRICT;

If i use this function (SELECT testfunc ( 0.1, 0.2 )) I get result with 
type "double precision". I tried used float4 but the result was the 
same. What is wrong?



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] Why there are no max_wal_receivers

2013-10-06 Thread 高健
Hello :


I found that for PG9.2.4, there is parameter max_wal_senders,

But there is no parameter of max_wal_receivers.



Is that to say, that If  max_wal_senders are 3.

Then 3 wal_senders will be activated ,



And then on the standby server, there will be 3 "receivers" for
counter-part ?



Thanks



Jian Gao


Re: [GENERAL] Why there are no max_wal_receivers

2013-10-06 Thread Amit Langote
Hi,

On Mon, Oct 7, 2013 at 12:02 PM, 高健  wrote:
> Hello :
>
>
> I found that for PG9.2.4, there is parameter max_wal_senders,
>
> But there is no parameter of max_wal_receivers.
>
>

max_wal_senders is the maximum number of WAL sender processes that a
primary server can create in response to requests from the standby
servers. One WAL sender process is created on the primary server for
each standby which would running the corresponding WAL receiver. So
there is one-to-one mapping between WAL senders and WAL receivers
(standbys).

>
> Is that to say, that If  max_wal_senders are 3.
>
> Then 3 wal_senders will be activated ,
>
>
>
> And then on the standby server, there will be 3 "receivers" for counter-part
> ?
>

max_wal_senders=3 means, there can be maximum 3 standby servers
requesting primary to send the WAL.
So, while the primary server may be running multiple WAL senders,
there is only one WAL receiver on each standby server.

--
Amit Langote


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general