Re: [GENERAL] Freezing localtimestamp and other time function on some value

2016-04-12 Thread Tom Lane
I wrote: > 3. While I can see the point of wanting to, say, test weekend behavior > on a weekday, I do not see how a value of now() that doesn't advance > between transactions would represent a realistic test environment for > an app with time-dependent behavior. BTW, one possible way of meeting

Re: [GENERAL] Freezing localtimestamp and other time function on some value

2016-04-12 Thread David G. Johnston
On Tue, Apr 12, 2016 at 10:14 AM, Alex Ignatov wrote: > > > On 12.04.2016 19:45, David G. Johnston wrote: > > On Tue, Apr 12, 2016 at 8:37 AM, Alex Ignatov < > a.igna...@postgrespro.ru> wrote: > >> >> On 12.04.2016 18:01, Adrian Klaver wrote:

Re: [GENERAL] Freezing localtimestamp and other time function on some value

2016-04-12 Thread David G. Johnston
On Tue, Apr 12, 2016 at 8:37 AM, Alex Ignatov wrote: > > On 12.04.2016 18:01, Adrian Klaver wrote: > >> >> >>I do it by having the date be one of the function arguments and have > the default be something like current_date. When I test I supply a date to > override the

Re: [GENERAL] Table seems empty but its size is in gigabytes

2016-04-12 Thread David G. Johnston
On Tue, Apr 12, 2016 at 9:30 AM, John R Pierce wrote: > On 4/12/2016 9:16 AM, David G. Johnston wrote: > > Now my big table statistics shows tuples inserted and its size is in order >> of gigabytes, but a simple SELECT has no rows, is there any way to recover >> the data in

Re: [GENERAL] Freezing localtimestamp and other time function on some value

2016-04-12 Thread Alex Ignatov
On 12.04.2016 19:45, David G. Johnston wrote: On Tue, Apr 12, 2016 at 8:37 AM, Alex Ignatov >wrote: On 12.04.2016 18:01, Adrian Klaver wrote: >>I do it by having the date be one of the function arguments and have the

Re: [GENERAL] Freezing localtimestamp and other time function on some value

2016-04-12 Thread Tom Lane
Alex Ignatov writes: > You always should keep in mind that your application may run in test > mode (future/past time) and maintain this code. While with my proposal > you can always use some time function(now or localtimestamp or > whatever) which you can freeze at

Re: [GENERAL] Table seems empty but its size is in gigabytes

2016-04-12 Thread John R Pierce
On 4/12/2016 9:16 AM, David G. Johnston wrote: Now my big table statistics shows tuples inserted and its size is in order of gigabytes, but a simple SELECT has no rows, is there any way to recover the data in this table? ​Do you want to recover the dead data or the space ​that it

Re: [GENERAL] Table seems empty but its size is in gigabytes

2016-04-12 Thread Juan Carlos Michaca Lucero
I want to recover the dead data El Martes, 12 de abril, 2016 11:38:22, David G. Johnston escribió: Send all replies to the list please.  In this specific case I'm not going to be of much help but others should be.  You are likely going to need to supply

Re: [GENERAL] pg_upgrade error regarding hstore operator

2016-04-12 Thread Tom Lane
"Feld, Michael (IMS)" writes: > Thanks for the reply Tom. template1 is definitely empty and does not contain > any hstore objects. I did a little debugging and placed the below SQL before > and after the hstore creation in the file produced by the pg_dump and > determined

Re: [GENERAL] pgpool-II: cannot use serializable mode in a hot standby

2016-04-12 Thread Tatsuo Ishii
> On 04/12/2016 16:50, Adrian Klaver wrote: >> On 04/12/2016 01:06 AM, Alexander Pyhalov wrote: >>> Hi. >>> >>> We have application which explicitly does >>> set default_transaction_isolation to 'serializable' . >>> It is connected to PostgreSQL master/slave cluster through pgpool-II >>> (pgpool2

Re: [GENERAL] Freezing localtimestamp and other time function on some value

2016-04-12 Thread Adrian Klaver
On 04/12/2016 10:14 AM, Alex Ignatov wrote: On 12.04.2016 19:45, David G. Johnston wrote: On Tue, Apr 12, 2016 at 8:37 AM, Alex Ignatov <a.igna...@postgrespro.ru>wrote: On 12.04.2016 18:01, Adrian Klaver wrote: >>I do it by having the date be one

Re: [GENERAL] Table seems empty but its size is in gigabytes

2016-04-12 Thread Adrian Klaver
On 04/12/2016 09:11 AM, Juan Carlos Michaca Lucero wrote: Hi PostgreSQL, I'm using PostgreSQL 9.3 running on Ubuntu Server. I have a complex function to populate a big table, in order to improve performance; data is prepared in temporary tables before it will be inserted. I called this function

[GENERAL] pgpool-II: cannot use serializable mode in a hot standby

2016-04-12 Thread Alexander Pyhalov
Hi. We have application which explicitly does set default_transaction_isolation to 'serializable' . It is connected to PostgreSQL master/slave cluster through pgpool-II (pgpool2 3.4.3-1.pgdg70+1). Our logs are filling with ERROR: 0A000: cannot use serializable mode in a hot standby DETAIL:

[GENERAL] Freezing localtimestamp and other time function on some value

2016-04-12 Thread Alex Ignatov
Hello! Is there any method to freeze localtimestamp and other time function value. Say after freezing on some value sequential calls to these functions give you the same value over and over again. This is useful primarily for testing. In oracle there is alter system set fixed_date command.

Re: [GENERAL] Freezing localtimestamp and other time function on some value

2016-04-12 Thread Petr Korobeinikov
2016-04-12 13:50 GMT+03:00 Alex Ignatov : > Hello! > Is there any method to freeze localtimestamp and other time function value. > Say after freezing on some value sequential calls to these functions give > you the same value over and over again. > This is useful

Re: [GENERAL] Freezing localtimestamp and other time function on some value

2016-04-12 Thread Petr Korobeinikov
Sorry. I have re-read my previous message. It looks unclean. For sequential calls in same transaction `now()` and `current_timestamp` will produce the same output. ``` begin; -- start a transaction select now() immutable_now, current_timestamp immutable_current_ts, clock_timestamp()

Re: [GENERAL] Freezing localtimestamp and other time function on some value

2016-04-12 Thread Rakesh Kumar
I think PG does fixed time within a tran. check the output of the following sql begin; select now() ; select pg_sleep(10); select now() ; commit; select now() ; select pg_sleep(10); select now() ; ~ On Tue, Apr 12, 2016 at 6:50 AM, Alex Ignatov wrote: > Hello! > Is

Re: [GENERAL] Freezing localtimestamp and other time function on some value

2016-04-12 Thread Pavel Stehule
Hi 2016-04-12 12:50 GMT+02:00 Alex Ignatov : > Hello! > Is there any method to freeze localtimestamp and other time function value. > Say after freezing on some value sequential calls to these functions give > you the same value over and over again. > This is useful

Re: [GENERAL] Freezing localtimestamp and other time function on some value

2016-04-12 Thread Alex Ignatov
On 12.04.2016 15:13, Rakesh Kumar wrote: I think PG does fixed time within a tran. check the output of the following sql begin; select now() ; select pg_sleep(10); select now() ; commit; select now() ; select pg_sleep(10); select now() ; ~ On Tue, Apr 12, 2016 at 6:50 AM, Alex Ignatov

Re: [GENERAL] pgpool-II: cannot use serializable mode in a hot standby

2016-04-12 Thread Adrian Klaver
On 04/12/2016 07:02 AM, Alexander Pyhalov wrote: On 04/12/2016 16:50, Adrian Klaver wrote: On 04/12/2016 01:06 AM, Alexander Pyhalov wrote: Hi. We have application which explicitly does set default_transaction_isolation to 'serializable' . It is connected to PostgreSQL master/slave cluster

Re: [GENERAL] pgpool-II: cannot use serializable mode in a hot standby

2016-04-12 Thread Alexander Pyhalov
On 04/12/2016 16:50, Adrian Klaver wrote: On 04/12/2016 01:06 AM, Alexander Pyhalov wrote: Hi. We have application which explicitly does set default_transaction_isolation to 'serializable' . It is connected to PostgreSQL master/slave cluster through pgpool-II (pgpool2 3.4.3-1.pgdg70+1). Our

Re: [GENERAL] pgpool-II: cannot use serializable mode in a hot standby

2016-04-12 Thread Adrian Klaver
On 04/12/2016 01:06 AM, Alexander Pyhalov wrote: Hi. We have application which explicitly does set default_transaction_isolation to 'serializable' . It is connected to PostgreSQL master/slave cluster through pgpool-II (pgpool2 3.4.3-1.pgdg70+1). Our logs are filling with ERROR: 0A000: cannot

Re: [GENERAL] Freezing localtimestamp and other time function on some value

2016-04-12 Thread George Neuner
On Tue, 12 Apr 2016 13:50:11 +0300, Alex Ignatov wrote: >Is there any method to freeze localtimestamp and other time function value. >Say after freezing on some value sequential calls to these functions >give you the same value over and over again. >This is useful

[GENERAL] Fastest way to duplicate a quite large database

2016-04-12 Thread Edson Richter
Hi! I have a database "Customer" with about 60Gb of data. I know I can backup and restore, but this seems too slow. Is there any other option to duplicate this database as "CustomerTest" as fast as possible (even fastar than backup/restore) - better if in one operation (something like "copy

Re: [GENERAL] Freezing localtimestamp and other time function on some value

2016-04-12 Thread Alex Ignatov
On 12.04.2016 16:57, George Neuner wrote: On Tue, 12 Apr 2016 13:50:11 +0300, Alex Ignatov wrote: Is there any method to freeze localtimestamp and other time function value. Say after freezing on some value sequential calls to these functions give you the same value

Re: [GENERAL] Fastest way to duplicate a quite large database

2016-04-12 Thread John R Pierce
On 4/12/2016 7:25 AM, Edson Richter wrote: I have a database "Customer" with about 60Gb of data. I know I can backup and restore, but this seems too slow. Is there any other option to duplicate this database as "CustomerTest" as fast as possible (even fastar than backup/restore) - better if

Re: [GENERAL] Freezing localtimestamp and other time function on some value

2016-04-12 Thread Adrian Klaver
On 04/12/2016 07:36 AM, Alex Ignatov wrote: On 12.04.2016 16:57, George Neuner wrote: On Tue, 12 Apr 2016 13:50:11 +0300, Alex Ignatov wrote: Is there any method to freeze localtimestamp and other time function value. Say after freezing on some value sequential

Re: [GENERAL] Fastest way to duplicate a quite large database

2016-04-12 Thread Adrian Klaver
On 04/12/2016 07:51 AM, Edson Richter wrote: Same machine, same cluster - just different database name. Hmm, running tests against the same cluster you are running the production database would seem to be a performance hit against the production database and potentially dangerous should the

Re: [GENERAL] Fastest way to duplicate a quite large database

2016-04-12 Thread Edson Richter
Same machine, same cluster - just different database name. Atenciosamente, Edson Carlos Ericksson Richter Em 12/04/2016 11:46, John R Pierce escreveu: On 4/12/2016 7:25 AM, Edson Richter wrote: I have a database "Customer" with about 60Gb of data. I know I can backup and restore, but this

Re: [GENERAL] Fastest way to duplicate a quite large database

2016-04-12 Thread John McKown
On Tue, Apr 12, 2016 at 9:25 AM, Edson Richter wrote: > Hi! > > I have a database "Customer" with about 60Gb of data. > I know I can backup and restore, but this seems too slow. > > Is there any other option to duplicate this database as "CustomerTest" as > fast as

Re: [GENERAL] Fastest way to duplicate a quite large database

2016-04-12 Thread Louis Battuello
> On Apr 12, 2016, at 10:51 AM, Edson Richter wrote: > > Same machine, same cluster - just different database name. > > Atenciosamente, > > Edson Carlos Ericksson Richter > > Em 12/04/2016 11:46, John R Pierce escreveu: >> On 4/12/2016 7:25 AM, Edson Richter wrote:

Re: [GENERAL] Fastest way to duplicate a quite large database

2016-04-12 Thread John R Pierce
On 4/12/2016 7:55 AM, John McKown wrote: Hum, I don't know exactly how to do it, but on Linux, you could put the "Customer" database in a tablespace which resides on a BTRFS filesystem. BTRFS can do a quick "snapshot" of the filesystem except, tablespaces aren't standalone, and there's no

Re: [GENERAL] Fastest way to duplicate a quite large database

2016-04-12 Thread Louis Battuello
> On Apr 12, 2016, at 11:14 AM, John R Pierce wrote: > > On 4/12/2016 7:55 AM, John McKown wrote: >> Hum, I don't know exactly how to do it, but on Linux, you could put the >> "Customer" database in a tablespace which resides on a BTRFS filesystem. >> BTRFS can do a quick

Re: [GENERAL] Freezing localtimestamp and other time function on some value

2016-04-12 Thread Alex Ignatov
On 12.04.2016 18:01, Adrian Klaver wrote: On 04/12/2016 07:36 AM, Alex Ignatov wrote: On 12.04.2016 16:57, George Neuner wrote: On Tue, 12 Apr 2016 13:50:11 +0300, Alex Ignatov wrote: Is there any method to freeze localtimestamp and other time function value. Say

RES: [GENERAL] Fastest way to duplicate a quite large database

2016-04-12 Thread Edson Richter
De: Adrian Klaver Enviado:terça-feira, 12 de abril de 2016 12:04 Para: Edson Richter; pgsql-general@postgresql.org Assunto: Re: [GENERAL] Fastest way to duplicate a quite large database On 04/12/2016 07:51 AM, Edson Richter wrote: > Same machine, same cluster - just different database name.

Re: [GENERAL] Fastest way to duplicate a quite large database

2016-04-12 Thread John McKown
On Tue, Apr 12, 2016 at 10:14 AM, John R Pierce wrote: > On 4/12/2016 7:55 AM, John McKown wrote: > >> Hum, I don't know exactly how to do it, but on Linux, you could put the >> "Customer" database in a tablespace which resides on a BTRFS filesystem. >> BTRFS can do a quick

Re: [GENERAL] Table seems empty but its size is in gigabytes

2016-04-12 Thread David G. Johnston
On Tue, Apr 12, 2016 at 9:11 AM, Juan Carlos Michaca Lucero < jc_mich2c...@yahoo.com.mx> wrote: > Hi PostgreSQL, > > I'm using PostgreSQL 9.3 running on Ubuntu Server. > > I have a complex function to populate a big table, in order to improve > performance; data is prepared in temporary tables