Re: [GENERAL] PL/PGSQL + inserts+updates+limit - Postgres 9.3

2016-06-06 Thread Patrick B
Ok so guys CREATE or REPLACE FUNCTION function_data_1() RETURNS SETOF bigint AS $$ declare row record; BEGIN [...] FOR row IN EXECUTE ' SELECT t1.file_id, t1.path, t1.account_id FROM

Re: [GENERAL] [HACKERS] OUT parameter and RETURN table/setof

2016-06-06 Thread Sridhar N Bamandlapally
Existing application code written to call function in Oracle which return no.of rows in out parameter and return-values is cursor-result this need migrate to PostgreSQL, need help here example: (actual function declaration only) *Oracle:* CREATE OR REPLACE PROCEDURE sc_getapppermissionlist (

Re: [GENERAL] Postgres Dropped DB have recovered files how to restore

2016-06-06 Thread John R Pierce
On 6/6/2016 4:09 PM, Alvaro Herrera wrote: I have no idea about Windows filesystems but you may be able to "undelete" the files, as long as you don't touch the partition for anything else; search the web for "undelete ntfs". Once you undelete you will need to put them back in the right places.

Re: [GENERAL] Re-sync slave server

2016-06-06 Thread Patrick B
My set up: Master --> slave01 (streaming replication) --> slave02 (streaming replication) Master --> slave03 (wal_files 4 days old, not streaming replication) The wal_files are stored into each server. But when the slave03 was down, the wal_files weren't being copied into it. We took too long

Re: [GENERAL] Re-sync slave server

2016-06-06 Thread Adrian Klaver
On 06/06/2016 05:11 PM, Patrick B wrote: Hi guys, I'm using PostgreSQL 9.2 There is a backup server that is 4 days old replication by wal_files (not streaming) However, the server went down and I lost some wal_files.. and now the replication is not working... What is your set up?:

[GENERAL] Re-sync slave server

2016-06-06 Thread Patrick B
Hi guys, I'm using PostgreSQL 9.2 There is a backup server that is 4 days old replication by wal_files (not streaming) However, the server went down and I lost some wal_files.. and now the replication is not working... Question: Do I need to sync all the data folder from my master Or

Re: [GENERAL] Postgres Dropped DB have recovered files how to restore

2016-06-06 Thread Alvaro Herrera
lifetronics wrote: > This morning I accidently deleted my database for my OpenERP accounting. I > did not have a good backup system setup so I was unable to do a system > restore. i did manage to recover the files the drop command removed but I > dont know how to get the DB back into postgres? Can

Re: [GENERAL] Postgres Dropped DB have recovered files how to restore

2016-06-06 Thread Dave Cramer
Ok, 1) back up the file system now as it is. So you can start over when this doesn't work. 2) create an empty database again with no data, but all of the DDL. 3) figure out the names of the new database files, and copy your old ones in with the same name as the new ones 4) cross your fingers. I

Re: [GENERAL] Postgres Dropped DB have recovered files how to restore

2016-06-06 Thread Adrian Klaver
On 06/04/2016 01:20 PM, lifetronics wrote: This morning I accidently deleted my database for my OpenERP accounting. I did not have a good backup system setup so I was unable to do a system restore. i did manage to recover the files the drop command removed but I dont know how to get the DB back

Re: [GENERAL] Why threads every 30 seconds?

2016-06-06 Thread Tom Lane
Bryan Henderson writes: > Looking at audit logs, I see that my Postgresql server generates a new thread > precisely every 30 seconds, in two series (so 4 threads every minute). This > is an otherwise idle server. > Does anyone know what these threads are for? Just

[GENERAL] mobile apps: async repl/sync

2016-06-06 Thread Wim Bertels
Hallo, some loose thoughts on mobile app development. * Users want mobile apps to be quick and snappy as they call it. So if the app has to do (a lot of) queries to a remote datasource, it won't be fast and snappy. * For a while now json is a popular choice with programmers (of mobile apps, who

[GENERAL] Why threads every 30 seconds?

2016-06-06 Thread Bryan Henderson
Looking at audit logs, I see that my Postgresql server generates a new thread precisely every 30 seconds, in two series (so 4 threads every minute). This is an otherwise idle server. Does anyone know what these threads are for? Just curious. -- Bryan Henderson

[GENERAL] Postgres Dropped DB have recovered files how to restore

2016-06-06 Thread lifetronics
This morning I accidently deleted my database for my OpenERP accounting. I did not have a good backup system setup so I was unable to do a system restore. i did manage to recover the files the drop command removed but I dont know how to get the DB back into postgres? Can anyone help me with this.

Re: [GENERAL] postgres_fdw and Kerberos authentication

2016-06-06 Thread Stephen Frost
Jean-Marc, * Jean-Marc Lessard (jean-marc.less...@ultra-ft.com) wrote: > Stephen Frost [sfr...@snowman.net] wrote: > > The database owner operating system user has to be trusted, along with any > > superusers in the database, but if you assume those, then having PG manage > > the different

Re: [GENERAL] Whither recovery.conf?

2016-06-06 Thread Richard Tisch
On Mon, Jun 6, 2016 at 10:12 PM, Vik Fearing wrote: > On 06/06/16 15:07, Vik Fearing wrote: >> It seems the commitfest link in there doesn't work anymore. I should >> probably bring that up in a separate thread. > > It's in the old commitfest app. Here's a new link for it:

Re: [GENERAL] Whither recovery.conf?

2016-06-06 Thread Vik Fearing
On 06/06/16 15:07, Vik Fearing wrote: > It seems the commitfest link in there doesn't work anymore. I should > probably bring that up in a separate thread. It's in the old commitfest app. Here's a new link for it: https://commitfest-old.postgresql.org/action/patch_view?id=1293 -- Vik Fearing

Re: [GENERAL] Whither recovery.conf?

2016-06-06 Thread Vik Fearing
On 06/06/16 14:50, Richard Tisch wrote: > Hi there, > > I was just wondering about the statement below in another thread: > > 2016-06-04 22:58 GMT+09:00 Vik Fearing : >> There are plans to allow SQL >> access to the parameters in recovery.conf (or to merge them into >>

Re: [GENERAL] WAL's listing in pg_xlog by some sql query

2016-06-06 Thread Stephen Frost
* Vik Fearing (v...@2ndquadrant.fr) wrote: > On 03/06/16 04:32, Michael Paquier wrote: > > On Fri, Jun 3, 2016 at 11:23 AM, Sameer Kumar > > wrote: > >> On Fri, Jun 3, 2016 at 4:30 AM Stephen Frost wrote: > >>> Given the usefulness of this specific

[GENERAL] Whither recovery.conf?

2016-06-06 Thread Richard Tisch
Hi there, I was just wondering about the statement below in another thread: 2016-06-04 22:58 GMT+09:00 Vik Fearing : > There are plans to allow SQL > access to the parameters in recovery.conf (or to merge them into > postgresql.conf) but that's not currently possible. Are

Re: [GENERAL] [HACKERS] OUT parameter and RETURN table/setof

2016-06-06 Thread David G. Johnston
On Mon, Jun 6, 2016 at 7:17 AM, Sridhar N Bamandlapally < sridhar@gmail.com> wrote: > Hi > > Is there any option in PGPLSQL which can RETURNS table or SETOF rows along > with an OUT parameter? > > ​No, there would be no point given the internals of how functions work. ​What is it you are

[GENERAL] OUT parameter and RETURN table/setof

2016-06-06 Thread Sridhar N Bamandlapally
Hi Is there any option in PGPLSQL which can RETURNS table or SETOF rows along with an OUT parameter? please Thanks Sridhar OpenText

Re: [GENERAL] ALTER TABLE and vacuum

2016-06-06 Thread Vik Fearing
On 06/06/16 10:55, Rick Widmer wrote: > Do I need to vacuum after an alter table command? If the specific command you do rewrites the table, you absolutely should vacuum in order to restore the visibility map. Otherwise, it not necessary. > Does it matter if there is a default or if we accept

[GENERAL] ALTER TABLE and vacuum

2016-06-06 Thread Rick Widmer
Do I need to vacuum after an alter table command? Does it matter if there is a default or if we accept NULLs for the new field? -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Replication

2016-06-06 Thread Bertrand Paquet
Hi, Thx you for answering. Regards, Bertrand 2016-06-06 10:22 GMT+02:00 Vik Fearing : > On 06/06/16 09:54, Masahiko Sawada wrote: > > On Sat, Jun 4, 2016 at 10:58 PM, Vik Fearing wrote: > >> On 02/06/16 15:32, Bertrand Paquet wrote: > >>> Hi, > >>> >

Re: [GENERAL] Replication

2016-06-06 Thread Vik Fearing
On 06/06/16 09:54, Masahiko Sawada wrote: > On Sat, Jun 4, 2016 at 10:58 PM, Vik Fearing wrote: >> On 02/06/16 15:32, Bertrand Paquet wrote: >>> Hi, >>> >>> On an hot standby streaming server, is there any way to know, in SQL, to >>> know the ip of current master ? >> >> No.

Re: [GENERAL] Replication

2016-06-06 Thread Masahiko Sawada
On Sat, Jun 4, 2016 at 10:58 PM, Vik Fearing wrote: > On 02/06/16 15:32, Bertrand Paquet wrote: >> Hi, >> >> On an hot standby streaming server, is there any way to know, in SQL, to >> know the ip of current master ? > > No. > >> The solution I have is to read the