Re: [GENERAL] Bucardo syncrun

2017-10-26 Thread Greg Sabino Mullane
er of rows deleted, you should also: vacuum full bucardo.syncrun; The data in that table is not critical to Bucardo running - it is mostly used for the output of "bucardo status" and for auditing of past syncs. P.S. Bucardo has its own mailing list: bucardo-gene...@bucardo.org, which in gener

Re: [GENERAL] Is pgbouncer still maintained?

2017-10-15 Thread Greg Sabino Mullane
d skills to get a new release out (myself, Andrew D., Peter E., probably others). - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201710150923 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 --

Re: [GENERAL] Run statements before pg_dump in same transaction?

2017-03-24 Thread Greg Sabino Mullane
ical copy of the affected tables (i.e. with indexes) but just a data-only copy: create table dev.users as select * from public.users; pg_dump herokudb --schema-only | psql devdb pg_dump herokudb --data-only -T public.users | psql devdb psql devdb -c 'insert into public.users select * from dev.user

Re: [GENERAL] streaming replication protocol in Perl?

2017-01-02 Thread Greg Sabino Mullane
cool to have it > directly in Perl. Well if you end up writing something, please throw it into CPAN so we can all benefit. :) - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201701021822 http://biglumb

Re: [GENERAL] pg_sample

2016-10-19 Thread Greg Sabino Mullane
d envision some workarounds, but it really depends on exactly what the OP is trying to achieve. - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201610191401 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 -BEGI

Re: [GENERAL] pg_sample

2016-10-18 Thread Greg Sabino Mullane
by 1 limit %s) TO STDOUT' | psql testdb -c 'COPY %I FROM STDIN' $$, table_name, 100, table_name) from information_schema.tables where table_schema = 'public' and table_type = 'BASE TABLE'; psql> \q $ sh dump.some.rows.sh - -- Greg Sabino Mullane g...@turn

Re: [GENERAL] Uber migrated from Postgres to MySQL

2016-07-27 Thread Greg Sabino Mullane
. :) What really bites is the analyze afterwards. That's the part that takes too long (yes, --in-stages helps some). Would love to see progress made there. - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 20160727222

Re: [GENERAL] MediaWiki + PostgreSQL is not ready for production?

2016-07-19 Thread Greg Sabino Mullane
so: https://www.mediawiki.org/wiki/How_to_become_a_MediaWiki_hacker https://phabricator.wikimedia.org/T2384 (Postgres support tracking) - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201607191015 http://biglumber.com/x/web?pk=2529DF6AB8F79407E944

Re: [GENERAL] Migrate 2 DB`s - v8.3

2016-05-27 Thread Greg Sabino Mullane
then you can use pg_dump | psql for the rest. - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201605272040 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8

Re: [GENERAL] 9.5 regression with unwanted nested loop left join

2016-05-24 Thread Greg Sabino Mullane
f this issue pops up anywhere else. Leaning towards the latter, as I'm sure the planner *usually* does better with all options enabled. :) -- Greg Sabino Mullane g...@endpoint.com End Point Corporation PGP Key: 0x14964AC8 signature.asc Description: PGP signature

[GENERAL] 9.5 regression with unwanted nested loop left join

2016-05-24 Thread Greg Sabino Mullane
pearance of nested loop *earlier* a few days. Changing cpu_tuple_cost moves it forward a bit, but not enough to cover the actual use case (now() - 1 month). Leaving out the 'analyze' results in a much better plan, but having the tables stay unanalyzed does not seem like a

Re: [GENERAL] Let's Do the CoC Right

2016-01-22 Thread Greg Sabino Mullane
ts. I think this may indeed be one of those times that we do not attempt to "roll our own". Or at the very least, we should strive to understand how other communities arrived at their Codes and why it is working for them. - -- Greg Sabino Mullane g...@turnstep.com PGP Key

Re: [GENERAL] CoC [Final]

2016-01-18 Thread Greg Sabino Mullane
fforts in this. - -- Greg Sabino Mullane g...@turnstep.com PGP Key: 0x14964AC8 201601181316 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 -BEGIN PGP SIGNATURE- iEYEAREDAAYFAladLAkACgkQvJuQZxSWSsjOZwCgqKxe5Uw9ujJIwCzWj4YHfVm9 etQAmwa1R5P8iPONXCgV9OMDiAaaTu/5 =awg

Re: [GENERAL] WIP: CoC

2016-01-11 Thread Greg Sabino Mullane
own. Needed? I know part of a code of conduct is stating the obvious, but... > 6. The CoC is not about Social Justice. Really no need for this. Defensive, and introduces a loaded term. Thanks, JD, for pushing this forward. - -- Greg Sabino Mullane g...@tur

Re: [GENERAL] Code of Conduct: Is it time?

2016-01-05 Thread Greg Sabino Mullane
this same thing recently. I disagree that it is a waste of time, but I'm happy if we get one, regardless of different people's rationales for it. - -- Greg Sabino Mullane g...@turnstep.com PGP Key: 0x14964AC8 201601051213 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B90671496

Re: [GENERAL] This utility can only upgrade to PostgreSQL version 9.4

2015-07-27 Thread Greg Sabino Mullane
uld be improved. - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201507270953 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 -BEGIN PGP SIGNATURE- iEYEAREDAAYFAlW2OAEACgkQvJuQZxSWSsj1CgCeKU8QO2dEHgBV6Su9D2eJmIss MT

Re: [GENERAL] database-level lockdown

2015-07-05 Thread Greg Sabino Mullane
ed, then try again. If you don't know which tables are being used, I suggest storing that somewhere your class can find it, or moving away from such a generic class. There are other solutions (e.g. forcing conflicting processes to quit and sleep a second), but the locking one seems the

Re: [GENERAL] PostgreSQL HA config recommendations

2015-04-30 Thread Greg Sabino Mullane
ased, not statement at all. It stores up a list of affected rows, then COPYs those from the source databases to the target ones. It's particularly strong when you have large delays and many updates to the same row. - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.end

Re: [GENERAL] Performance on DISABLE TRIGGER (resend)

2015-03-03 Thread Greg Sabino Mullane
better way is to use the session_replication_role feature. See: http://blog.endpoint.com/2015/01/postgres-sessionreplication-role.html - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201502271149 http://biglumbe

Re: [GENERAL] Performance on DISABLE TRIGGER

2015-02-27 Thread Greg Sabino Mullane
binK_rPgnIklP.bin Description: charset

Re: [GENERAL] Sync production DB with development?

2014-10-08 Thread Greg Sabino Mullane
lly given the tradeoff in complexity. Still, if the majority of the time is spent moving old data from one or more tables, you could exclude those from the pg_dump with -T, then copy over some small subset of the table with a pair of COPY commands from prod to dev. - -- Greg Sabino

Re: [GENERAL] pgbouncer setup in the architecture

2014-08-24 Thread Greg Sabino Mullane
ur layout, usage pattern, network speeds, etc. - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201408240939 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 -BEGIN PGP SIGNATURE- iEYEAREDAAYFAlP5/9

Re: [GENERAL] Re: any way for a transaction to "see" inserts done earlier in the transaction?

2014-04-18 Thread Greg Sabino Mullane
hen the postgresql.conf is created via initdb.) - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201404181453 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 -BEGIN PGP SIGNATURE- iEYEAREDAAYFAlNRdVkACgkQv

Re: [GENERAL] any way for a transaction to "see" inserts done earlier in the transaction?

2014-04-17 Thread Greg Sabino Mullane
d in such a bug. - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201404171231 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 -BEGIN PGP SIGNATURE- iEYEAREDAAYFAlNQAe8ACgkQvJuQZxSWSshObwCglozBhwT4ddf7XacITK

Re: [GENERAL] libpq - lack of support to set the fetch size

2014-04-02 Thread Greg Sabino Mullane
e request for 10,000 rows to libpq rather than call PQgetResult 10,000 times, but we'll move ahead with implementing RowCacheSize via PQsetSingleRowMode. - -- Greg Sabino Mullane g...@turnstep.com PGP Key: 0x14964AC8 201404021428 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC

Re: [GENERAL] Better Connection Statistics

2014-02-08 Thread Greg Sabino Mullane
ce or SystemTap. - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201402081451 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 -BEGIN PGP SIGNATURE- iEYEAREDAAYFAlL2itEACgkQvJuQZxSWSshlIgCgo+jkIYojwc23O4jw

Re: [GENERAL] PG replication across DataCenters (section 25 in the manual)

2013-12-10 Thread Greg Sabino Mullane
ies". Bucardo and Slony are both table-based and trigger-driven. - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201312100859 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 -BEGIN PGP SIGNATURE-

Re: [GENERAL] Replication Postgre > Oracle

2013-08-26 Thread Greg Sabino Mullane
o from Postgres to Oracle. - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201308262157 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 -BEGIN PGP SIGNATURE- iEYEAREDAAYFAlIcB6AACgkQvJuQZx

Re: [GENERAL] How to convert numbers into words in postgresql

2013-05-14 Thread Greg Sabino Mullane
numwords(int) > returns text > language plperlu > immutable > as ' > use Lingua::EN::Inflect qw( NUMWORDS ); > return NUMWORDS(shift); > '; > eot CREATE FUNCTION $ psql -tc 'select numwords(1234)' one thousand, two hundred and thirty-four

Re: [GENERAL] session_replication_role `replica` behavior

2013-04-25 Thread Greg Sabino Mullane
ser functions some brains, such that they will not execute when session_replication_role is set to 'local', for example. While I do think session_replication_role needs some more granularity, it's also a little hard to say more without knowing your exact requirements. - -- Greg Sabi

Re: [GENERAL] PostgreSQL Downgrades

2013-04-08 Thread Greg Sabino Mullane
d if you have a dump from 9.1 or older, you can use this script to divide it up into the same sections: http://bucardo.org/wiki/Split_postgres_dump - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201304081134

Re: [GENERAL] pltcl and modules question

2013-03-27 Thread Greg Sabino Mullane
little more involved. See: http://www.postgresql.org/docs/9.2/static/plperl-under-the-hood.html - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201303271036 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906

Re: [GENERAL] Updating pg_attribute to widen column

2012-11-30 Thread Greg Sabino Mullane
RCHAR(64), it doesn't matter if an existing client sees that change or not - the data will still be stored exactly the same. You can always put a heavy lock on pg_attribute to ensure everyone sees the change. - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint

Re: [GENERAL] Updating pg_attribute to widen column

2012-11-29 Thread Greg Sabino Mullane
p://blog.endpoint.com/2012/11/postgres-alter-column-problems-and.html - -- Greg Sabino Mullane g...@endpoint.com g...@turnstep.com End Point Corporation 610-983-9073 PGP Key: 0x14964AC8 201211300113 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 ---

Re: [GENERAL] pg_listening_channels()

2012-11-29 Thread Greg Sabino Mullane
this > change was not thought through completely. On the contrary, it was very well discussed and designed. Why do you even care if the anyone is listening or not? Simply remove the "check if anyone listens" step and send the NOTIFY. If you really need to know if anyone is liste

Re: [GENERAL] Question about PostgreSQL logging configuration

2012-11-29 Thread Greg Sabino Mullane
esn't. Thus, if log_duration is on and log_min_duration_statement has a positive value, all durations are logged but the query text is included only for statements exceeding the threshold. This behavior can be useful for gathering statistics in high-load installations." - -- Greg Sabin

Re: [GENERAL] Question about PostgreSQL logging configuration

2012-11-29 Thread Greg Sabino Mullane
u care about how fast sub-10ms mods ran? - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201211292253 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 -BEG

Re: [GENERAL] pg_listening_channels()

2012-11-28 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 Igor Neyman asked: [Postgres 9.2] > How (if it's even possible) can I get listening channels > for all sessions/ connections in the database? No, this is not possible. You can only see items from your own session. - -- Greg Sab

Re: [GENERAL] [BUGS] Prepared Statement Name Truncation

2012-11-21 Thread Greg Sabino Mullane
input, which warrants more than a notice IMO. Separately, what are the objections to raising the size limit to 128? - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201211211525 http://bi

Re: [GENERAL] [BUGS] Prepared Statement Name Truncation

2012-11-17 Thread Greg Sabino Mullane
ard limit and ERROR instead of truncating and NOTICE? > Both? Neither because that would break backward compatibility? My vote is WARNING and bump limit to 128 in 9.3. That's the combo most likely to make dumb applications work better while not breaking existing smart ones. - -- Gr

Re: [GENERAL] Planner chooses multi-column index in 9.2 when maybe it should not

2012-10-10 Thread Greg Sabino Mullane
ce Postgres v6. (Looking back at how far Postgres has come from 6.x to 9.2 is truly awe-inspiring) -- Greg Sabino Mullane g...@endpoint.com End Point Corporation PGP Key: 0x14964AC8 pgp5oFeJLefSg.pgp Description: PGP signature

Re: [GENERAL] Planner chooses multi-column index in 9.2 when maybe it should not

2012-10-10 Thread Greg Sabino Mullane
x27;))) Heap Fetches: 0 -> Index Scan using baz_id on baz (C=0..101 R=40 W=22) (AT=0.1..0.2 R=7 L=1) Index Cond: ((o.id) = (id)) Filter: (price <> 0::numeric) Rows Removed by Filter: 3 Total runtime: 34502.670 ms Yeah34 seconds versus near-in

Re: [GENERAL] Planner chooses multi-column index in 9.2 when maybe it should not

2012-10-10 Thread Greg Sabino Mullane
and > the seqscan plan in 9.2. Thanks, I will play around with both a better test case and getting some explain analyzes (they were taking too long to run; thought I should get the email out first in case it was something obvious). -- Greg Sabino Mullane g...@endpoint.com End Point Corporation PGP Key: 0x14964AC8 pgpn2mbk5zwEr.pgp Description: PGP signature

[GENERAL] Planner chooses multi-column index in 9.2 when maybe it should not

2012-10-10 Thread Greg Sabino Mullane
rimary key on foo, and an index named index_i on foobar(status, foo). In another variation of the query, 8.3 uses foobar_pkey as well, rather than index_i, and filters that. Matter of fact, index_i is never used. At any rate, the change causes the original query to run much, much slower. Problem on

Re: [GENERAL] Securing .pgpass File?

2012-10-01 Thread Greg Sabino Mullane
mply not use pgpass, and find some other means to authenticate. - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201210011859 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 -

Re: [GENERAL] Is there a way to use "pack" in pl/perl without resorting to pl/perlu?

2012-09-13 Thread Greg Sabino Mullane
ed. Remember in general to add a /o to the end of your regex if the first part is constant to avoid unneeded recomplilation. - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201209131324 http://biglumber.com/

Re: [GENERAL] Bug? Prepared queries continue to use search_path from their preparation time

2012-07-12 Thread Greg Sabino Mullane
l libraries are those? - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201207121257 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 -BEGIN PGP SIGNATURE- iEYEAREDAAYFAk//AlQACgkQvJuQZxSWSsj6IACgzQJlK5Y1u

Re: [GENERAL] Feature discussion: Should syntax errors abort a transaction?

2012-06-20 Thread Greg Sabino Mullane
s against our philosophy of being safe, careful, and correct. - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201206200945 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 -BEGIN PGP SIGNATURE- iEY

Re: [GENERAL] Feature discussion: Should syntax errors abort a transaction?

2012-06-19 Thread Greg Sabino Mullane
ly if you are using psql in interactive mode. In other words, we already have an elegant and lightweight approach to the described problem. - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201206191146 ht

Re: [GENERAL] Use LISTEN/NOTIFY between different databases

2012-05-08 Thread Greg Sabino Mullane
anything that goes cross-database is subject to lots of very careful care and handling, and I doubt adding that complexity is worth the small benefit gained. - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 2012

Re: [GENERAL] recommended schema diff tools?

2012-04-17 Thread Greg Sabino Mullane
ardo.org/wiki/Check_postgres It allows you to compare the schemas of any number of databases to each other, and also compare a schema to an earlier version of itself, which can be used for things such as mailing a list of all schema changes in the last 24 hours, for example. - -- Greg Sabino Mullane g...

Re: [GENERAL] Using DEFAULT as a parameter value with PQexecPrepare()

2012-04-06 Thread Greg Sabino Mullane
se PQexecParams() to get some SQL injection > protection and avoid the escaping and quoting of the parameter values. One other way I should mention is that if your app knows it, it can always pass in the default value(s) directly. :) - -- Greg Sabino Mullane g...@turnstep.com End Poin

Re: [GENERAL] Using DEFAULT as a parameter value with PQexecPrepare()

2012-04-05 Thread Greg Sabino Mullane
(c1,c2,c3,c4,c5) VALUES ($1,$2,DEFAULT,$3,$4); or PREPARE myinsert2 AS INSERT INTO t(c1,c2,c4,c5) VALUES ($1,$2,$3,$4); - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201204052214 http://biglumber.com/x/web?pk=2529DF6AB8F7940

Re: [GENERAL] Leaky Perl / DBIx / Postgres 9.0.1 Trio

2012-04-04 Thread Greg Sabino Mullane
, DBD::Pg. Do you know what version of it you are running? There have been various memory leak problems fixed over the years. The latest is 2.19.2. Your first solution should be to upgrade that if needed. - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com

Re: [GENERAL] Adding new and changed data

2012-04-03 Thread Greg Sabino Mullane
ltable SELECT DISTINCT t1.* FROM temptable t1, (SELECT date,time,MAX(interval_length) AS imax FROM temptable t2 GROUP BY 1,2 ) AS t2 WHERE t1.date=t2.date AND t1.time=t2.time AND t1.interval_length=t2.imax; - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoi

Re: [GENERAL] compilation info without pg_config

2012-03-26 Thread Greg Sabino Mullane
stros: pg_config is put into the -devel package. > Is there another way to determine that? You can use ldd on the postgres executable, e.g. $ ldd /usr/local/bin/postgres | grep gss libgssapi_krb5.so.2 => /lib/libgssapi_krb5.so.2 (0x0414d000) - -- Greg Sabino Mullane g...@turnstep.com E

Re: [GENERAL] Multi master use case?

2012-01-28 Thread Greg Sabino Mullane
or the latter, use the latest Bucardo5 beta, as Bucardo4 will be deprecated soon: http://bucardo.org/downloads/Bucardo-4.99.3.tar.gz - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201201281026 http://

Re: [GENERAL] any plans to support more rounding methods in sql?

2012-01-25 Thread Greg Sabino Mullane
atures that can be handled by extensions, user written functions, etc. are not likely to be added to core. But who knows, there may be a valid use case. First thing I would do is try a wrapper to a Python or Perl function, mark it IMMUTABLE, and see just how slow it really is. - --

Re: [GENERAL] Logging access to data in database table

2012-01-25 Thread Greg Sabino Mullane
n't too painful. The general idea is: - --- $dbh = DBI->connect(...) $sth = $dbh->prepare('INSERT into log_table...'); $sth->execute(@values); $dbh->commit(); Fetch the data as normal, and return to the user. - --- Of course, you would want to cache the $dbh and

Re: [GENERAL] 9.1.2: Preventing connections / syncing a database

2012-01-02 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 Jay Levitt spoke: >>Greg Sabino Mullane wrote: >> update pg_database set datallowconn = false where datname = 'foobar'; >That's perfect - thanks. Now I can (I think) do this: > > pg_restore -d rai

Re: [GENERAL] 9.1.2: Preventing connections / syncing a database

2012-01-01 Thread Greg Sabino Mullane
u, I'd keep that as long as you can. Try fiddling with some of the compressions, etc. to maximize speed. Quick ideas: try nc or tweak rsync, and on the slave: turn fsync off, boost maintenance_work_mem and checkpoint_segments, look into parallel restore. - -- Greg Sabino Mullane g...@tu

Re: [GENERAL] Selective backup script

2011-11-21 Thread Greg Sabino Mullane
ALTER DATABASE testdb1 CONNECTION LIMIT 9218; Not as intuitive as a comment, but a lot more visible that something is different about the database. - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 20211715 http://biglumbe

Re: [GENERAL] Are file system level differential/incremental backups possible?

2011-10-22 Thread Greg Sabino Mullane
erentials would be great, though. FWIW, Bucardo 5 has a 'flatfile' mode that will output the deletion and insert statements to get a table from an old state to a new one. Not quite what is being asked for here, but could be useful for similar things as well as for auditing.

Re: [GENERAL] Has Pg 9.1.0 been released today?

2011-09-12 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 > You mean I don't get my money back if I don't like it??? :-) Are you kidding? You get *twice* your money back, and you get to keep the product! - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endp

Re: [GENERAL] LISTEN filtering

2011-06-21 Thread Greg Sabino Mullane
er exposed to anyone else. Thanks, I think that neatly solved the problem. (which wasn't too much of a problem, more an idle thought). - -- Greg Sabino Mullane g...@endpoint.com g...@turnstep.com End Point Corporation 610-983-9073 PGP Key: 0x14964AC8 2

Re: [GENERAL] abusing session_replication_mode

2011-06-21 Thread Greg Sabino Mullane
C or just a weird entry on an existing one, like ssl_renogiation_limit = 543210). - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201106211944 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 --

[GENERAL] LISTEN filtering

2011-06-21 Thread Greg Sabino Mullane
o LISTEN that said "I only want to hear notices coming from superusers"? Or perhaps an option that says "I only want to hear notices coming from me (same role)"? This would not affect notifications at all, but would simply act as a quick filter on incoming notice

Re: [GENERAL] determine client os

2011-06-13 Thread Greg Sabino Mullane
n do this easily in trusted perl: CREATE OR REPLACE FUNCTION findos() RETURNS TEXT LANGUAGE plperl AS $$ return $^O; $$; SELECT findos(); findos - ---- linux - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201106130831 http://big

Re: [GENERAL] Bidirectional replication

2011-05-28 Thread Greg Sabino Mullane
he child creator and the parent deleter receive back a "ok commit". If you have a very large async response time, and your application has a very tight control over things, it may cause a problem, but in real life the syncing happens quite quickly, and the window for even catc

Re: [GENERAL] Bidirectional replication

2011-05-08 Thread Greg Sabino Mullane
, no? > [1] The code is still hanging around somewhere, I think, mostly > as an example of what not to do. Heh, I gotta look that up someday. - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201105082255 http://biglumber.com/x/

Re: [GENERAL] Bidirectional replication

2011-05-08 Thread Greg Sabino Mullane
rks just fine, as long as you are not expecting the servers to give the exact same answer at the exact same time. But certainly transactions are "valid". - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 20110508

Re: [GENERAL] Bidirectional replication

2011-05-08 Thread Greg Sabino Mullane
der verison of ExtUtils::MakeMaker. DBD::Pg 1.49 is pretty old, but the good news is that nearly every other repo in the world has a newer version, and that it has very few dependencies if you want to install it manually. - -- Greg Sabino Mullane g...@turnstep.com PGP Key: 0x14964AC8 201105

Re: [GENERAL] Switching Database Engines

2011-04-26 Thread Greg Sabino Mullane
nsions is hit or miss because MediaWiki was a MySQL only shop for so long (and Wikimedia still uses it, and they influence a lot of the MW development). - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201104261505

Re: [GENERAL] Switching Database Engines

2011-04-26 Thread Greg Sabino Mullane
an't promise it will work with recent versions of MediaWiki, but should be enough to get you started testing. - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201104261344 http://biglumber.com/x/web?pk=2529DF6AB8F79407E944

[GENERAL] DBD::Pg 2.18.0 released

2011-03-30 Thread Greg Sabino Mullane
(CPAN bug #61713) [GSM] - Fix failing test when run as non-superuser [GSM] (CPAN bug #61534) -- Greg Sabino Mullane g...@endpoint.com End Point Corporation PGP Key: 0x14964AC8 pgp7dOKYW9uya.pgp Description: PGP signature

Re: [GENERAL] disable triggers using psql

2011-02-21 Thread Greg Sabino Mullane
replica; > pro-# \o db.out > pro-# \i dump.txt This is a database set, not a psql on, so you do not want the backslash before the "set". SET session_replication_role = replica; I'd recommend adding a: SHOW session_replication_role; to the dump.txt as a sanity check. - --

Re: [GENERAL] disable triggers using psql

2011-02-18 Thread Greg Sabino Mullane
ase could be very bad. - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201102181408 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 -BEGIN PGP SIGNATURE- iEYEAREDAAYFAk1ew9MACgkQvJuQZxSWSshETwCg2oE

Re: [GENERAL] disable triggers using psql

2011-02-18 Thread Greg Sabino Mullane
narrowed: > INSERT 0 1 This shows the session_replication_role is working as it should. Double check where and how you are setting it; your foreign key problems will go away once it is set correctly. - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.co

Re: [GENERAL] disable triggers using psql

2011-02-18 Thread Greg Sabino Mullane
SELECT * FROM def; ROLLBACK; - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201102180938 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 -BEGIN PGP SIGNATURE- iEYEAREDAAYFAk1ehJEACgkQvJuQZxSWSsj

Re: [GENERAL] disable triggers using psql

2011-02-17 Thread Greg Sabino Mullane
happening. Most likely session_replication_role is not getting set or is getting reset somewhere. - -- Greg Sabino Mullane g...@endpoint.com g...@turnstep.com End Point Corporation 610-983-9073 PGP Key: 0x14964AC8 201102172155 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC

Re: [GENERAL] disable triggers using psql

2011-02-17 Thread Greg Sabino Mullane
:'; INSERT INTO def(b) VALUES (1); SET session_replication_role = replica; SELECT 'No error:'; INSERT INTO def(b) VALUES (2); SELECT * FROM def; ROLLBACK; - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key

Re: [GENERAL] disable triggers using psql

2011-02-17 Thread Greg Sabino Mullane
iple transactions. If this is a script you are feeding directly to psql, you can also add a BEGIN; at the top or just use the -1 argument. - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 2011021715

Re: [GENERAL] disable triggers using psql

2011-02-17 Thread Greg Sabino Mullane
id this fail? This should absolutely disable all triggers for you, unless you've mucked with the triggers and set them to replica. - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201102171053 http:/

Re: [GENERAL] Why does my DB size differ between Production and DR? (Postgres 8.4)

2011-02-01 Thread Greg Sabino Mullane
list the first bloated table and stop. No, it will show all tables over the given threshhold. However, the statement "the other tables must be OK" is definitely not a given, as the bloat calculation used by check_postgres is a very rough one. - -- Greg Sabino Mullane g

Re: [GENERAL] Cannot unsubscribe

2010-12-22 Thread Greg Sabino Mullane
#x27;s going on. Feel free to forward me those headers (offlist) and I'll try to get you unsubscribed. - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201012221216 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906

Re: [GENERAL] Table both does not and does exist! wth?

2010-12-17 Thread Greg Sabino Mullane
at already exists, not the xtmp_changed_ids TABLE. If it was the table, we'd presumably see the ERROR appear before the NOTICE (as the table is created first, and then the indexes). Thus, make sure you don't have an index named xtmp_changed_ids somewhere already: \di xtmp_c

Re: [GENERAL] monitoring warm standby lag in 8.4?

2010-12-10 Thread Greg Sabino Mullane
n for this is that the pg_controldata check is "good enough". Certainly, that's what we are using for many clients via check_postgres, and it's been very good at detecting when the replica has problems. Good enough that I've never worried about writing a different method

Re: [GENERAL] Checking for data changes across a very large table

2010-12-10 Thread Greg Sabino Mullane
es or simply increment the values in the table itself like a version control number). - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201012100942 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94

Re: [GENERAL] I want to create a read only database for a specified user.

2010-11-16 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 > I now want to have this database or all tables capable of read-only. ALTER DATABASE foo SET default_transaction_read_only = true; Easy to work around, but may be good enough for your purposes. - -- Greg Sabino Mullane g...@turnstep.

Re: [GENERAL] querying the version of libpq

2010-10-06 Thread Greg Sabino Mullane
not run-time. Correct, not sure of your point. Is this a problem? Build-time is what we want here (determining the libpq we were built with) - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201010060816 ht

Re: [GENERAL] querying the version of libpq

2010-10-05 Thread Greg Sabino Mullane
gt; libpq that may be installed on the machine you are actually linking > against? Not sure what you mean. pg_config *drives* the compilation and linking, we don't blindly compile and simply take pg_config's word for it. pg_config --libdir and pg_config --includedir. - -- Greg Sabino M

Re: [GENERAL] querying the version of libpq

2010-10-05 Thread Greg Sabino Mullane
you're linked to --- if it's even present at all. Er...yes it will match exact...because we[1] get the location of the library files from pg_config as well. :) Handy little utility that. [1] DBD::Pg - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoi

Re: [GENERAL] querying the version of libpq

2010-10-05 Thread Greg Sabino Mullane
1) It's not available on older versions 2) It returns the *target* version, not the *compiled* version. In other words, it requires an existing PGconn object. - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201010051212 htt

Re: [GENERAL] querying the version of libpq

2010-10-05 Thread Greg Sabino Mullane
the information to the C programs for directive fiddling. I certainly hope other drivers are doing the same, as libpq varies across major versions a good deal. - -- Greg Sabino Mullane g...@turnstep.com PGP Key: 0x14964AC8 201010051132 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B90

Re: [GENERAL] queriing the version of libpq

2010-10-05 Thread Greg Sabino Mullane
a bug with psycopg2 if it does not provide that information. - -- Greg Sabino Mullane g...@turnstep.com PGP Key: 0x14964AC8 201010051030 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 -BEGIN PGP SIGNATURE- iEYEAREDAAYFAkyrNskACgkQvJuQZxSWSsiW7wCfYge62

Re: [GENERAL] psql \q hang

2010-10-04 Thread Greg Sabino Mullane
rhaps there is an issue writing to the ~/.psql_history file? Try running with --no-readline and see if it still happens. Otherwise, consider using strace or lsof to see what it is doing during those 20 seconds. - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoin

Re: [GENERAL] "private" installation of postgres

2010-09-07 Thread Greg Sabino Mullane
> - init the db somewhere within my own directory > - disallow IP connections > - set the socket directory somewhere within my own directory Yep, that should do it. I do this all the time for testing various programs. Set the socket with pg_ctl -o "-k newsocketdir" - -- Greg Sabino M

Re: [GENERAL] Why DBI (DBD::Pg) takes so much memory ?

2010-08-12 Thread Greg Sabino Mullane
8/x86_64-linux-thread-multi/auto/DBD/Pg/Pg.so > libpq.so.4 => /usr/lib64/libpq.so.4 (0x2b8adedb7000) That's probably your problem. libpq.so.5 came out with Postgres 8.2, in 2006. See if you can get newer libraries, and the problem might go away. Specifically, you need the p

Re: [GENERAL] Finding last checkpoint time

2010-07-23 Thread Greg Sabino Mullane
ork, however, when I set LANGUAGE (LC_MESSAGES has no effect). Specifically, LANGUAGE changes the headers of pg_controldata (but not the actual output, LC_ALL does that). Thanks for the nudge, I'll get to rewriting some code. - -- Greg Sabino Mullane g...@turnstep.com End Point Corporati

Re: [GENERAL] Finding last checkpoint time

2010-07-22 Thread Greg Sabino Mullane
s.pl. Needless to say, I'd greatly prefer some other way to grab the information! - -- Greg Sabino Mullane g...@turnstep.com PGP Key: 0x14964AC8 201007220933 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 -BEGIN PGP SIGNATURE- iEYEAREDAAYFAkxISMwACgkQvJuQZxSWSs

  1   2   3   >