[GENERAL] Re: Hot standby problems: consistent state not reached, no connection to master server.

2015-04-13 Thread Ilya Ashchepkov
On Mon, 13 Apr 2015 12:24:11 -0700 Adrian Klaver wrote: > On 04/13/2015 11:25 AM, Ilya Ashchepkov wrote: > > On Mon, 13 Apr 2015 10:06:05 -0700 > > Adrian Klaver wrote: > > > >> On 04/13/2015 09:42 AM, Ilya Ashchepkov wrote: > >>> On Sun, 12 Apr 2015 17:30:44 -0700 > >>> Adrian Klaver wrote: >

Re: [GENERAL] bigserial continuity safety

2015-04-13 Thread David G. Johnston
On Mon, Apr 13, 2015 at 7:01 PM, Jim Nasby wrote: > On 4/13/15 7:45 PM, David G. Johnston wrote: > >> On Mon, Apr 13, 2015 at 3:05 PM, Pawel Veselov > >wrote: >> >> >> Hi. >> >> If I have a table created as: >> >> CREATE TABLE xq_agr ( >>id

Re: [GENERAL] With Update From ... vs. Update ... From (With)

2015-04-13 Thread Jim Nasby
On 4/13/15 8:12 PM, David G. Johnston wrote: Hello! Is there any non-functional difference between these two forms of Update? WITH name AS ( SELECT ) UPDATE tbl SET ... FROM name WHERE tbl.id = name.id and UPDATE tbl SET ... FROM ( WITH qry AS ( SELECT ) SELEC

Re: [GENERAL] Help with slow table update

2015-04-13 Thread Jim Nasby
On 4/13/15 7:01 PM, Pawel Veselov wrote: Cursors tend to make things slow. Avoid them if you can. Is there an alternative to iterating over a number of rows, where a direct update query is not an option? I really doubt that either the actual processing logic, including use of types has any

Re: [GENERAL] bigserial continuity safety

2015-04-13 Thread Jim Nasby
On 4/13/15 7:45 PM, David G. Johnston wrote: On Mon, Apr 13, 2015 at 3:05 PM, Pawel Veselov mailto:pawel.vese...@gmail.com>>wrote: Hi. If I have a table created as: CREATE TABLE xq_agr ( idBIGSERIAL PRIMARY KEY, node text not null );

Re: [GENERAL] recovery of a windows archive in linux

2015-04-13 Thread Adrian Klaver
On 04/13/2015 04:37 PM, Guillaume Drolet wrote: Dear list, I have a base backup and archive logs from a Windows 7 PGSQL 9.3 install. The machine OS disk started to show signs of failure so I replaced it and now I want to switch for a Linux system. My question is: will I be able to play my archi

Re: [GENERAL] recovery of a windows archive in linux

2015-04-13 Thread Jim Nasby
On 4/13/15 6:37 PM, Guillaume Drolet wrote: Dear list, I have a base backup and archive logs from a Windows 7 PGSQL 9.3 install. The machine OS disk started to show signs of failure so I replaced it and now I want to switch for a Linux system. My question is: will I be able to play my archive l

[GENERAL] With Update From ... vs. Update ... From (With)

2015-04-13 Thread David G. Johnston
Hello! Is there any non-functional difference between these two forms of Update? WITH name AS ( SELECT ) UPDATE tbl SET ... FROM name WHERE tbl.id = name.id and UPDATE tbl SET ... FROM ( WITH qry AS ( SELECT ) SELECT * FROM qry ) AS name WHERE tbl.id = name.id They both better give the same re

Re: [GENERAL] Help with slow table update

2015-04-13 Thread David G. Johnston
On Mon, Apr 13, 2015 at 5:01 PM, Pawel Veselov wrote: > > r_agrio_hourly - "good", r_agrio_total - "bad". > > Update on r_agrio_hourly (cost=0.42..970.32 rows=250 width=329) (actual > time=2.248..2.248 rows=0 loops=1) >-> Index Scan using u_r_agrio_hourly on r_agrio_hourly > (cost=0.42..9

Re: [GENERAL] bigserial continuity safety

2015-04-13 Thread David G. Johnston
On Mon, Apr 13, 2015 at 3:05 PM, Pawel Veselov wrote: > Hi. > > If I have a table created as: > > CREATE TABLE xq_agr ( > idBIGSERIAL PRIMARY KEY, > node text not null > ); > > and that multiple applications insert into. The applications never > explicitly specify

Re: [GENERAL] Help with slow table update

2015-04-13 Thread Pawel Veselov
On Sun, Apr 12, 2015 at 5:40 PM, Jim Nasby wrote: > On 4/9/15 6:18 PM, Pawel Veselov wrote: > >> Hi. >> >> I have a plpgsql procedure that updates a few similar tables. >> for some reason, updates on one of the tables take a lot longer the >> updates on the other ones. The difference is, say, 7 s

[GENERAL] recovery of a windows archive in linux

2015-04-13 Thread Guillaume Drolet
Dear list, I have a base backup and archive logs from a Windows 7 PGSQL 9.3 install. The machine OS disk started to show signs of failure so I replaced it and now I want to switch for a Linux system. My question is: will I be able to play my archive logs and point-in-time recover on the Linux mac

[GENERAL] bigserial continuity safety

2015-04-13 Thread Pawel Veselov
Hi. If I have a table created as: CREATE TABLE xq_agr ( idBIGSERIAL PRIMARY KEY, node text not null ); and that multiple applications insert into. The applications never explicitly specify the value for 'id'. Is it safe to, on a single connection, do: - open tra

Re: [GENERAL] Hot standby problems: consistent state not reached, no connection to master server.

2015-04-13 Thread Guillaume Lelarge
Le 12 avr. 2015 16:50, "Ilya Ashchepkov" a écrit : > > Hello. > > I'm setting up hot standby slave. > It recovers from wal archive files, but I can't connect to it: > $ psql > psql: FATAL: the database system is starting up > > On master: > # select name,setting from pg_settings where name like '

Re: [GENERAL] Re: Hot standby problems: consistent state not reached, no connection to master server.

2015-04-13 Thread Adrian Klaver
On 04/13/2015 11:25 AM, Ilya Ashchepkov wrote: On Mon, 13 Apr 2015 10:06:05 -0700 Adrian Klaver wrote: On 04/13/2015 09:42 AM, Ilya Ashchepkov wrote: On Sun, 12 Apr 2015 17:30:44 -0700 Adrian Klaver wrote: If a connection is not being made: 1) Dose user replication have REPLICATIO

[GENERAL] Re: Hot standby problems: consistent state not reached, no connection to master server.

2015-04-13 Thread Ilya Ashchepkov
On Mon, 13 Apr 2015 10:06:05 -0700 Adrian Klaver wrote: > On 04/13/2015 09:42 AM, Ilya Ashchepkov wrote: > > On Sun, 12 Apr 2015 17:30:44 -0700 > > Adrian Klaver wrote: > > > > > >>> > >>> Oh! I missed this! Thank you! > >>> Now slave reached consistent state some time after start, but > >

Re: [GENERAL] unexpected error " tables can have at most 1600 columns"

2015-04-13 Thread Day, David
Pavel, Thanks so much. This seems to help explain the problem. I can say that the patch file had a later statement with an error related to search_path setup. Given that the logic that applies patches repeat attempts for an extended period of time, I speculate that the rollback of the patch l

Re: [GENERAL] Pgagent

2015-04-13 Thread Ramesh T
no error messages.. i checked at PostgreSQL\9.4\data\pg_log Didn't deleted data from table.after schedule time.. one thing i don't understand ,after set timings and in definition section also the function works fine individually. any help.. On Mon, Apr 13, 2015 at 8:47 PM, Adrian Klaver wro

Re: [GENERAL] PG-9.3.6, unable to "drop role because some objects depend on it"

2015-04-13 Thread Dennis Jenkins
Doh. I found my answer. Tome posted it years ago.. http://www.postgresql.org/message-id/18994.1325874...@sss.pgh.pa.us I have to connect to the offending database and try to "drop role" again to get the list of actual objects. One database cannot query the catalog of another. On Mon, Apr 13, 2

Re: [GENERAL] PG-9.3.6, unable to "drop role because some objects depend on it"

2015-04-13 Thread Dennis Jenkins
Apologies for the typo of your name in my last post, Tom. On Mon, Apr 13, 2015 at 12:16 PM, Dennis Jenkins < dennis.jenkins...@gmail.com> wrote: > Doh. I found my answer. Tome posted it years ago.. > http://www.postgresql.org/message-id/18994.1325874...@sss.pgh.pa.us > > I have to connect to th

[GENERAL] Pgagent

2015-04-13 Thread Ramesh T
Hi all, i have a function to delete data from table.Where i need to place function in pgagent.in definition section can i select SQL or BATCH ..? or else any other method.? Any Help..

Re: [GENERAL] Pgagent

2015-04-13 Thread Ramesh T
Hi, in steps>definition-> do $body$ begin perform delete_empty_parts(); end; $body$ delete_empty_parts is the function i do selected SQL option in step process.Right clicked on job chosen run now it getting failed(On error i selected failed,if select success it getting success) I'm running funct

[GENERAL] PG-9.3.6, unable to "drop role because some objects depend on it"

2015-04-13 Thread Dennis Jenkins
I am attempting to remove a "role" from Postgresql-9.3.6. I've already reassigned ownership for the role's tables, functions, sequences, types, views, etc... However, I am still unable to remove the role. Postgresql reports that "8 objects in the database 'postgres'" depend on this role. How do

Re: [GENERAL] Re: Hot standby problems: consistent state not reached, no connection to master server.

2015-04-13 Thread Adrian Klaver
On 04/13/2015 09:42 AM, Ilya Ashchepkov wrote: On Sun, 12 Apr 2015 17:30:44 -0700 Adrian Klaver wrote: Oh! I missed this! Thank you! Now slave reached consistent state some time after start, but still no connection to master server and still restoring wal-files. Not quite sure what you

[GENERAL] Re: Hot standby problems: consistent state not reached, no connection to master server.

2015-04-13 Thread Ilya Ashchepkov
On Sun, 12 Apr 2015 17:30:44 -0700 Adrian Klaver wrote: > On 04/12/2015 08:25 AM, Ilya Ashchepkov wrote: > > On Sun, 12 Apr 2015 08:10:48 -0700 > > Adrian Klaver wrote: > > > >> On 04/12/2015 07:47 AM, Ilya Ashchepkov wrote: > >>> Hello. > >>> > >>> I'm setting up hot standby slave. > >>> It rec

Re: [GENERAL] unexpected error " tables can have at most 1600 columns"

2015-04-13 Thread Pavel Stehule
2015-04-13 17:57 GMT+02:00 Day, David : > Situation > > > > I have a co-developer installing a new Virtual Machine and encountering a > postgres error during the installation. > > One of our SQL patch files is failing unexpectedly. > > > > The patch is attempting to add columns to a table, The t

[GENERAL] unexpected error " tables can have at most 1600 columns"

2015-04-13 Thread Day, David
Situation I have a co-developer installing a new Virtual Machine and encountering a postgres error during the installation. One of our SQL patch files is failing unexpectedly. The patch is attempting to add columns to a table, The table involved currently has only 2 columns, Interactively I

Re: [GENERAL] Pgagent

2015-04-13 Thread Adrian Klaver
On 04/13/2015 07:22 AM, Ramesh T wrote: Hi, in steps>definition-> do $body$ begin perform delete_empty_parts(); end; $body$ delete_empty_parts is the function i do selected SQL option in step process.Right clicked on job chosen run now it getting failed(On error i selected failed,if select succ

Re: [GENERAL] schema or database

2015-04-13 Thread Jim Nasby
On 4/13/15 6:21 AM, Anil Menon wrote: In addition to all these comments - If you use multiple databases, if you want to keep some "common" tables (example counties_Table, My_company_details), its going to be a pain - if you want to access tables across databases - you might need to start using F

Re: [GENERAL] SELinux context of PostgreSQL connection process

2015-04-13 Thread Мартынов Александр
If the user is given the necessary permissions, then can the connection process get a context of the user? I mean a category and a level (sensibility) by context. Does the architecture of PostgreSQL permit to add changing a context of a connection process to context of the connecting user? 25.

Re: [GENERAL] Pgagent

2015-04-13 Thread Adrian Klaver
On 04/13/2015 06:53 AM, Ramesh T wrote: Hi all, i have a function to delete data from table.Where i need to place function in pgagent.in definition section can i select SQL or BATCH ..? or else any other method.? See here: http://www.pgadmin.org/docs/dev/pgagent.

Re: [GENERAL] schema or database

2015-04-13 Thread Anil Menon
In addition to all these comments - If you use multiple databases, if you want to keep some "common" tables (example counties_Table, My_company_details), its going to be a pain - if you want to access tables across databases - you might need to start using FDWs (which is going to be a administrati

Re: [GENERAL] schema or database

2015-04-13 Thread Pavel Stehule
2015-04-13 10:43 GMT+02:00 Albe Laurenz : > Michael Cheung wrote: > > I have many similar database to store data for every customer. > > Structure of database is almost the same. > > As I use same application to control all these data, so I can only use > > one database user to connect to these da

Re: [GENERAL] schema or database

2015-04-13 Thread Albe Laurenz
Michael Cheung wrote: > I have many similar database to store data for every customer. > Structure of database is almost the same. > As I use same application to control all these data, so I can only use > one database user to connect to these database. > And I have no needs to query table for diff

Re: [GENERAL] Limiting user from changing its own attributes

2015-04-13 Thread David G. Johnston
On Sun, Apr 12, 2015 at 10:23 PM, Sameer Kumar wrote: > > On Mon, Apr 13, 2015 at 1:03 PM Jim Nasby > wrote: > >> >> No. I suspect the community would support at least a hook for GUC >> changes, if not a full-on permissions system. A hook would make it >> fairly easy to add event trigger support

Re: [GENERAL] schema or database

2015-04-13 Thread John R Pierce
On 4/13/2015 12:07 AM, Alban Hertroys wrote: That's easier to backup, sure, but you can't restore a single customer's schema easily that way. So if one customer messes up their data big time, you'll need to restore a backup for all customers in the DB. if you use pg_dump -Fc, then you can spe

Re: [GENERAL] schema or database

2015-04-13 Thread Alban Hertroys
> On 13 Apr 2015, at 4:20, Ian Barwick wrote: > > On 13/04/15 11:08, Michael Cheung wrote: >> hi, all; >> >> I am new here. And I need some suggestion. >> >> I have many similar database to store data for every customer. >> Structure of database is almost the same. >> As I use same application