[GENERAL] pg_basebackup problem for Streaming replication

2015-09-02 Thread Sachin Srivastava
Dear Experts, One problem, I am facing that when I am using *pg_basebackup* (on Standby Server) it’s copying only some files and directories not all like pg_notify folder etc. That’s why when I am restarting the database on "Standby Server" after "pg_basebackup" then it’s showing an error below.

Re: [GENERAL] error on online backup using pg_basebackup tool

2015-09-02 Thread Gerdan Rezende dos Santos
Em quinta-feira, 3 de setembro de 2015, Michael Paquier < michael.paqu...@gmail.com> escreveu: > On Thu, Sep 3, 2015 at 12:20 PM, Gerdan Rezende dos Santos > > wrote: > >[...] > > Note 1: Please don't top-post. > Note 2: Please don't post across multiple mailing lists. > > > I use the tablespaces

Re: [GENERAL] error on online backup using pg_basebackup tool

2015-09-02 Thread Michael Paquier
On Thu, Sep 3, 2015 at 12:20 PM, Gerdan Rezende dos Santos wrote: >[...] Note 1: Please don't top-post. Note 2: Please don't post across multiple mailing lists. > I use the tablespaces without problem but the backup online not complete... > but when I attempt to online backup using the pg_baseba

Re: [GENERAL] error on online backup using pg_basebackup tool

2015-09-02 Thread Gerdan Rezende dos Santos
I use the tablespaces without problem but the backup online not complete... but when I attempt to online backup using the pg_basebackup displays the error message saying q pg_tblspc is not clean and the process is terminated without sucess Em quarta-feira, 2 de setembro de 2015, Michael Paquier <

Re: [GENERAL] [BUGS] error on online backup using pg_basebackup tool

2015-09-02 Thread Michael Paquier
On Thu, Sep 3, 2015 at 10:28 AM, Gerdan Rezende dos Santos wrote: > 6 - create table spaces: > CREATE TABLESPACE newtblspc LOCATION '/data/newtblspc'; > CREATE TABLESPACE newtblspc2 LOCATION '/data/pg_tblspc/newtblspc2' > 7 - mkdir /data2 > 8 - Now perform a backup using pg_basebackup -D /data2 an

Re: [GENERAL] get first and last row in one sql as two columns

2015-09-02 Thread Tom Smith
Thanks for suggestion. I could use two separate sqls, but I am looking to get it in a single sql. I just compiled and installed (under postgres id) first_last_agg C extension. http://pgxn.org/dist/first_last_agg/ it WORKED under postgres user with sample select first(column1), last(column1) from

[GENERAL] [BUGS] error on online backup using pg_basebackup tool

2015-09-02 Thread Gerdan Rezende dos Santos
Hi 4 all!! As Ido not know if it is my mistake or actually a bug, sending the two topics. When trying to perform online backup using the pg_basebackup tool, I get the message: The folder is not empty. steps to reproduce the error: 1 - install postgres in the / usr / local / pgsql 2 - initialize

[GENERAL] error on online backup using pg_basebackup tool

2015-09-02 Thread Gerdan Rezende dos Santos
Hi 4 all!! As Ido not know if it is my mistake or actually a bug, sending the two topics. When trying to perform online backup using the pg_basebackup tool, I get the message: The folder is not empty. steps to reproduce the error: 1 - install postgres in the / usr / local / pgsql 2 - initialize

Re: [GENERAL] Retrieve postgres password

2015-09-02 Thread Adrian Klaver
On 09/02/2015 04:43 PM, ray madigans.org wrote: I have lost/forgotten the postgres password for my installation so I did the following. I edited pg_hba.conf and added an entry: local all all trust restarted postgresql. loged in as postgres (psql template1 -U postgres) change the postgres pas

Re: [GENERAL] FDW and BDR

2015-09-02 Thread Craig Ringer
On 2 September 2015 at 20:40, Andres Freund wrote: > On 2015-09-02 20:27:40 +0800, Craig Ringer wrote: >> The reason for this is that BDR replicates at a database level, but >> CREATE SERVER and CREATE USER MAPPING are global, affecting all >> databases on a PostgreSQL install. BDR can't therefore

Re: [GENERAL] get first and last row in one sql as two columns

2015-09-02 Thread Melvin Davidson
Try this: SELECT (SELECT FROM ORDER BY offset 0 LIMIT 1) , (SELECT FROM ORDER BY OFFSET (SELECT COUNT(*) ) LIMIT 1) FROM LIMIT 1; On Wed, Sep 2, 2015 at 7:27 PM, Rob Sargent wrote: > On 09/02/2015 05:14 PM, Tom Smith wrote: > > Hi: > > I need to get the first

[GENERAL] Retrieve postgres password

2015-09-02 Thread ray madigans.org
I have lost/forgotten the postgres password for my installation so I did the following.I edited pg_hba.conf and added an entry: local all all trustrestarted postgresql. loged in as postgres (psql template1 -U postgres) change the postgres password withALTER ROLE postgres PASSWORD fooI edited pg_h

Re: [GENERAL] get first and last row in one sql as two columns

2015-09-02 Thread Rob Sargent
On 09/02/2015 05:14 PM, Tom Smith wrote: Hi: I need to get the first and last tow in one sql like below select first(col1), last(col1) from table order by col1 I saw some posting in wiki with a custom function (or C extention) to do this. Is it widely used and reliable? https://wiki.postgres

Re: [GENERAL] get first and last row in one sql as two columns

2015-09-02 Thread Rob Sargent
On 09/02/2015 05:14 PM, Tom Smith wrote: Hi: I need to get the first and last tow in one sql like below select first(col1), last(col1) from table order by col1 I saw some posting in wiki with a custom function (or C extention) to do this. Is it widely used and reliable? https://wiki.postgres

[GENERAL] get first and last row in one sql as two columns

2015-09-02 Thread Tom Smith
Hi: I need to get the first and last tow in one sql like below select first(col1), last(col1) from table order by col1 I saw some posting in wiki with a custom function (or C extention) to do this. Is it widely used and reliable? https://wiki.postgresql.org/wiki/First/last_(aggregate) I am wo

Re: [GENERAL] bdr admin role

2015-09-02 Thread Melvin Davidson
Oops postgres On Sep 2, 2015 6:06 PM, "Melvin Davidson" wrote: > Initdb as user "postgred", not "postgresql" > This doc specifies to initdb with the admin user "postgres," > http://bdr-project.org/docs/stable/quickstart-instances.html > but if I do that the supervisor falls over with: > $ cat bdr

Re: [GENERAL] bdr admin role

2015-09-02 Thread Melvin Davidson
Initdb as user "postgred", not "postgresql" This doc specifies to initdb with the admin user "postgres," http://bdr-project.org/docs/stable/quickstart-instances.html but if I do that the supervisor falls over with: $ cat bdr5598.log LOG: registering background worker "bdr supervisor" LOG: databas

Re: [GENERAL] Does PLPythonU support COPY table FROM string?

2015-09-02 Thread Dominik Czarnota
Unless I miss something, cursor won't help here - it is to retrieve data, not to insert it. I just need a missing feature of `plpy` to do COPY (actually doable, but from file). Anyway, after normalizing my tables and removing constraints and indexes for the time of data loading, the current solut

[GENERAL] bdr admin role

2015-09-02 Thread Ray Stell
This doc specifies to initdb with the admin user "postgres," http://bdr-project.org/docs/stable/quickstart-instances.html but if I do that the supervisor falls over with: $ cat bdr5598.log LOG: registering background worker "bdr supervisor" LOG: database system was shut down at 2015-09-02 16:04:

Re: [GENERAL] FDW and BDR

2015-09-02 Thread Alvaro Herrera
Andres Freund wrote: > On 2015-09-02 20:27:40 +0800, Craig Ringer wrote: > > The reason for this is that BDR replicates at a database level, but > > CREATE SERVER and CREATE USER MAPPING are global, affecting all > > databases on a PostgreSQL install. BDR can't therefore guarantee to > > replicate

Re: [GENERAL] FDW and BDR

2015-09-02 Thread Willy-Bas Loos
Haha, that is funny :) It's always nice to see problems evaporate. Thank's a lot for your answers. On Wed, Sep 2, 2015 at 2:40 PM, Andres Freund wrote: > Either way it should be > simple to implement. > > -- Willy-Bas Loos

Re: [GENERAL] FDW and BDR

2015-09-02 Thread Andres Freund
On 2015-09-02 20:27:40 +0800, Craig Ringer wrote: > The reason for this is that BDR replicates at a database level, but > CREATE SERVER and CREATE USER MAPPING are global, affecting all > databases on a PostgreSQL install. BDR can't therefore guarantee to > replicate CREATE SERVER to other nodes, s

Re: [GENERAL] Re: (expert) "insert into VIEW returning" inside an instead of trigger returns nothing

2015-09-02 Thread Willy-Bas Loos
On Wed, Sep 2, 2015 at 2:16 PM, Rémi Cura wrote: > I think I got it, > I have to always return something (like NEW) in the instead of trigger, > but fill NEW > with returnings of INSERT into regular table. > > Yes, the GID is detemined for the table. But in test.rc_editing_generic_object( ) you

Re: [GENERAL] FDW and BDR

2015-09-02 Thread Tom Lane
Craig Ringer writes: > On 2 September 2015 at 18:46, Willy-Bas Loos wrote: >> I've read that CREATE FOREIGN DATA WRAPPER currently is prohibited on BDR >> enabled databases. And other FDW and FTS related commands too. > Correct. > The reason for this is that BDR replicates at a database level,

Re: [GENERAL] FDW and BDR

2015-09-02 Thread Craig Ringer
On 2 September 2015 at 18:46, Willy-Bas Loos wrote: > Sorry, forgot [GENERAL] in the subject at first. You don't need to add it. The list manager software does that. > I've read that CREATE FOREIGN DATA WRAPPER currently is prohibited on BDR > enabled databases. And other FDW and FTS related com

[GENERAL] Re: (expert) "insert into VIEW returning" inside an instead of trigger returns nothing

2015-09-02 Thread Rémi Cura
I think I got it, I have to always return something (like NEW) in the instead of trigger, but fill NEW with returnings of INSERT into regular table. CHeers, Rémi-C 2015-09-02 13:44 GMT+02:00 Rémi Cura : > Hey list, > I'm stuck on a problem that I can't figure out (postgres 9.3). > In short, using

[GENERAL] (expert) "insert into VIEW returning" inside an instead of trigger returns nothing

2015-09-02 Thread Rémi Cura
Hey list, I'm stuck on a problem that I can't figure out (postgres 9.3). In short, using an INSERT INTO __view_with_trigger__ ... RETURNING gid INTO _gid; returns nothing. I need this feature because I use views on tables as user interface. ​This must have to do with the postgres order of executi

Re: [GENERAL] FDW and BDR

2015-09-02 Thread Willy-Bas Loos
Sorry, forgot [GENERAL] in the subject at first. On Wed, Sep 2, 2015 at 12:46 PM, Willy-Bas Loos wrote: > Hi, > > I've read that CREATE FOREIGN DATA WRAPPER currently is prohibited on BDR > enabled databases. And other FDW and FTS related commands too. > > This seems obvious, but i want to make

[GENERAL] FDW and BDR

2015-09-02 Thread Willy-Bas Loos
Hi, I've read that CREATE FOREIGN DATA WRAPPER currently is prohibited on BDR enabled databases. And other FDW and FTS related commands too. This seems obvious, but i want to make sure: Does that mean that FDW's are not supported at all in databases that use Bi-Directional Replication? (maybe one

Re: [GENERAL] Serial initial and incremental value

2015-09-02 Thread Thomas Kellerer
FarjadFarid(ChkNet) schrieb am 02.09.2015 um 11:05: > How can I obtain the initial and incremental value of a serial entity? You can use: select * from sequence_name; where "sequence_name" is the name of the sequence associated with your column. Thomas -- Sent via pgsql-general mai

Re: [GENERAL] BDR setup - bdr_node_join_wait_for_ready()

2015-09-02 Thread Craig Ringer
On 2 September 2015 at 00:12, cchee-ob wrote: > Craig, > > By an existing database, I mean I have a database that has our data on it. > I have created the btree_gist and bdr extensions and ran the > bdr.bdr_group_create () function and the bdr.bdr_node_join_wait_for_ready(), > all run successfull

[GENERAL] Serial initial and incremental value

2015-09-02 Thread FarjadFarid(ChkNet)
Sorry folks, I should have included this in my last question. How can I obtain the initial and incremental value of a serial entity? Many thanks Best Regards Farjad Farid

Re: [GENERAL] Detecting autoincrement columns

2015-09-02 Thread FarjadFarid(ChkNet)
Many thanks. From: Melvin Davidson [mailto:melvin6...@gmail.com] Sent: 02 September 2015 00:20 To: Tom Lane Cc: FarjadFarid(ChkNet); pgsql-general@postgresql.org Subject: Re: [GENERAL] Detecting autoincrement columns Try this: SELECT * FROM information_schema.columns WHERE UPPER(co