Re: [GENERAL] Begginers question

2017-08-16 Thread Michael Paquier
On Wed, Aug 16, 2017 at 2:32 PM, Alex Samad wrote: > 1) why did it fill up this time and not previously > I add this > archive_command = '/bin/true' > wal_keep_segments = 1000 # <<< I'm guessing its this > > 2) how do I fix up, can I just remove the files from the pg_xlog

[GENERAL] pg_column_size strange result...

2017-08-16 Thread marin
Hi, I was calculating row sizes with pg_column_size and came to this strange result: CREATE TABLE t1( c1 NUMERIC(10,7) NOT NULL DEFAULT 123.1234567 ); INSERT INTO t1(c1) VALUES (DEFAULT); SELECT pg_column_size(c1) AS first, pg_column_size(123.1234567::NUMERIC(10,7)) as second, c1 =

[GENERAL] optimize pg_tables query ( text vs varchar ) ...why ?

2017-08-16 Thread gmb
Hi For DDL purposes we make significant use of pg_catalog tables/views. Were investigating performance issues in a typical function: CREATE FUNCTION tableexists( s TEXT , t TEXT ) returns boolean as $$ SELECT count(tablename) = 1 FROM pg_tables WHERE schemaname=$1 and tablename=$2; $$

Re: [GENERAL] Begginers question

2017-08-16 Thread Achilleas Mantzios
On 16/08/2017 13:46, Alex Samad wrote: On 16 August 2017 at 16:16, Michael Paquier > wrote: On Wed, Aug 16, 2017 at 2:32 PM, Alex Samad > wrote: > 1) why did it fill up this

Re: [GENERAL] Begginers question

2017-08-16 Thread Alex Samad
On 16 August 2017 at 16:16, Michael Paquier wrote: > On Wed, Aug 16, 2017 at 2:32 PM, Alex Samad wrote: > > 1) why did it fill up this time and not previously > > I add this > > archive_command = '/bin/true' > > wal_keep_segments = 1000 # <<< I'm

Re: [GENERAL] optimize pg_tables query ( text vs varchar ) ...why ?

2017-08-16 Thread Tom Lane
gmb writes: > Tom Lane-2 wrote >> Personally I'd have left the function parameters as text and inserted >> explicit coercions: > Just out of curiosity , is there a reason why this will be you preference ? Well, if the rest of your code thinks that table names are of type

Re: [GENERAL] optimize pg_tables query ( text vs varchar ) ...why ?

2017-08-16 Thread vinny
On 2017-08-16 14:41, gmb wrote: Hi For DDL purposes we make significant use of pg_catalog tables/views. Were investigating performance issues in a typical function: CREATE FUNCTION tableexists( s TEXT , t TEXT ) returns boolean as $$ SELECT count(tablename) = 1 FROM pg_tables WHERE

Re: [GENERAL] pg_column_size strange result...

2017-08-16 Thread Tom Lane
ma...@kset.org writes: > Is there a reason pg_column_size returns different sizes for a constant > and the same value from a table column? The constant probably has the default choice of a four-byte length word, while the on-disk form has been compressed by switching to a one-byte length word.

Re: [GENERAL] optimize pg_tables query ( text vs varchar ) ...why ?

2017-08-16 Thread Tom Lane
gmb writes: > CREATE FUNCTION tableexists( s TEXT , t TEXT ) returns boolean as > $$ > SELECT count(tablename) = 1 FROM pg_tables WHERE schemaname=$1 and > tablename=$2; > $$ > language sql > When change the params of above function to VARCHAR (instead of TEXT), >

Re: [GENERAL] optimize pg_tables query ( text vs varchar ) ...why ?

2017-08-16 Thread gmb
Thanks for taking the time, Tom. Tom Lane-2 wrote > After that, the planner has to implement the query, and the problem > is that the available indexes are on "schemaname" not "schemaname::text", > and they can only use the name = name operator anyway. Did some digging earlier, and found

Re: [GENERAL] no pg_hba.conf entry for replication connection

2017-08-16 Thread Ian Barwick
On 08/17/2017 05:26 AM, armand pirvu wrote: Hi master (172.16.26.7) and slave (172.16.26.4) master runs on port 5433 though SELECT pglogical.create_subscription( subscription_name := 'shw_sub', replication_sets := '{shw_set}', provider_dsn := 'host=172.16.26.7 port=5433 dbname=levregdb

Re: [GENERAL] cluster question

2017-08-16 Thread Alex Samad
On 17 August 2017 at 10:51, Ian Barwick wrote: > On 08/16/2017 02:41 PM, Alex Samad wrote: > (...) > > > > okay think I have it setup, but when i do a switch over it gets stuck > here. > > > > > > > > NOTICE: STANDBY PROMOTE successful > > NOTICE: Executing pg_rewind

Re: [GENERAL] no pg_hba.conf entry for replication connection

2017-08-16 Thread armand pirvu
Yep relaoded But darn typo Finger going too fast I guess Thanks bunch AP > On Aug 16, 2017, at 8:03 PM, Ian Barwick wrote: > > On 08/17/2017 05:26 AM, armand pirvu wrote: >> Hi >> master (172.16.26.7) and slave (172.16.26.4) >> master runs on port 5433 though >>

Re: [GENERAL] cluster question

2017-08-16 Thread Ian Barwick
On 08/16/2017 02:41 PM, Alex Samad wrote: (...) > > okay think I have it setup, but when i do a switch over it gets stuck here. > > > > NOTICE: STANDBY PROMOTE successful > NOTICE: Executing pg_rewind on old master server > NOTICE: 3 files copied to /var/lib/pgsql/9.6/data > NOTICE: restarting

[GENERAL] Logging failed connections

2017-08-16 Thread Stephen Cook
Hello! When a client gets the error message about "remaining connection slots are reserved for non-replication superuser connections", is this logged? What should I be grep-ing for? Thanks! -- Stephen -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to

Re: [GENERAL] Logging failed connections

2017-08-16 Thread Jerry Sievers
Stephen Cook writes: > Hello! > > When a client gets the error message about "remaining connection slots > are reserved for non-replication superuser connections", is this logged? > What should I be grep-ing for? Grep for the token FATAL in your logs. > > Thanks! > > > --

Re: [GENERAL] optimize pg_tables query ( text vs varchar ) ...why ?

2017-08-16 Thread gmb
Thanks for this , Tom -- View this message in context: http://www.postgresql-archive.org/optimize-pg-tables-query-text-vs-varchar-why-tp5978592p5978654.html Sent from the PostgreSQL - general mailing list archive at Nabble.com. -- Sent via pgsql-general mailing list

Re: [GENERAL] Begginers question

2017-08-16 Thread Alex Samad
Great I will add it to my notes. Thanks On 16 August 2017 at 20:55, Achilleas Mantzios wrote: > On 16/08/2017 13:46, Alex Samad wrote: > > > > On 16 August 2017 at 16:16, Michael Paquier > wrote: > >> On Wed, Aug 16, 2017 at 2:32 PM,

[GENERAL] no pg_hba.conf entry for replication connection

2017-08-16 Thread armand pirvu
Hi master (172.16.26.7) and slave (172.16.26.4) master runs on port 5433 though SELECT pglogical.create_subscription( subscription_name := 'shw_sub', replication_sets := '{shw_set}', provider_dsn := 'host=172.16.26.7 port=5433 dbname=levregdb user=repuser'); ERROR: could not connect to the