Re: [GENERAL] Postgres 10.1 fails to start: server did not start in time

2017-11-10 Thread Joe Conway
ng. I installed from this repo: > http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main > > I was assuming someone in the Postgres project was involved in > packaging it. Do you know who I should reach out to in that case? I'm pretty sure Christoph Berg is at least involved. I c

Re: [GENERAL] [HACKERS] OpeSSL - PostgreSQL

2017-11-09 Thread Joe Conway
On 11/09/2017 05:52 PM, chiru r wrote: > If OpenSSL apply any patches at OS level, Is there any > changes/maintenance we need to perform at PostgreSQL end? > > On Thu, Nov 9, 2017 at 5:46 PM, Joe Conway wrote: >> Assuming you mean that you need only FIPS 140-2 compliant ciphers,

Re: [GENERAL] [HACKERS] OpeSSL - PostgreSQL

2017-11-09 Thread Joe Conway
lications? If you still need more control over what Postgres allows, see the ssl_ciphers configuration setting here: https://www.postgresql.org/docs/current/static/runtime-config-connection.html#GUC-SSL HTH, Joe -- Crunchy Data - http://crunchydata.com PostgreSQL Support for Secure Enterp

Re: [GENERAL] How to find out extension directory

2017-10-20 Thread Joe Conway
On 10/20/2017 02:10 PM, Tom Lane wrote: > "David G. Johnston" writes: >> On Fri, Oct 20, 2017 at 1:12 PM, rakeshkumar464 >> wrote: >>> How do I know beforehand where the dir path is ? > >> I think pg_config ( >> https://www.postgresql.org/docs/current/static/app-pgconfig.html ) is what >> you ar

[GENERAL] CTE in a Recursive Union

2017-08-29 Thread Joe Wildish
bly. Does anyone have other suggestions for how best to achieve a performant query? Thanks, -Joe -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] CTE in a Recursive Union

2017-08-29 Thread Joe Wildish
bly. Does anyone have other suggestions for how best to achieve a performant query? Thanks, -Joe -- 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] Audit based on role

2017-08-08 Thread Joe Conway
#x27; >AND g.rolname = 'module_dm;' > ORDER BY 1, 2; The problem with that query is is you have more than one level of nesting. E.g.: Role name | Attributes| Member of +---------

Re: [GENERAL] Audit based on role

2017-08-07 Thread Joe Conway
y against the system catalogs though to loop through the members of the group and execute this statement against each one. Maybe rerun it periodically. HTH, Joe -- Crunchy Data - http://crunchydata.com PostgreSQL Support for Secure Enterprises Consulting, Training, & Open Source Development

Re: [GENERAL] Limiting DB access by role after initial connection?

2017-06-09 Thread Joe Conway
ons will be > blocked. If set to "off," the log statement setting is left unchanged. Sounds good, will make that change or something similar -- thanks for the feedback. Joe -- Crunchy Data - http://crunchydata.com PostgreSQL Support for Secure Enterprises Consulting, Training, & Open Source Development signature.asc Description: OpenPGP digital signature

Re: [GENERAL] Limiting DB access by role after initial connection?

2017-06-09 Thread Joe Conway
On 06/09/2017 08:56 AM, Ken Tanzer wrote: > On Fri, Jun 9, 2017 at 6:42 AM, Joe Conway wrote: > See set_user for a possible solution: https://github.com/pgaudit/ > > Thanks! Looking at the README, it seems like the intended use case is > the opposite (escalating privil

Re: [GENERAL] Limiting DB access by role after initial connection?

2017-06-09 Thread Joe Conway
at this is not the case. See set_user for a possible solution: https://github.com/pgaudit/ HTH, Joe -- Crunchy Data - http://crunchydata.com PostgreSQL Support for Secure Enterprises Consulting, Training, & Open Source Development signature.asc Description: OpenPGP digital signature

Re: [GENERAL] Unable to connect to Postgresql

2017-04-09 Thread Joe Conway
On 04/09/2017 12:37 PM, John Iliffe wrote: >> > Thanks Joe. I Changed the pg_connect line in the script to: >> > $db_handle = pg_connect('dbname=yrarc host=192.168.1.6 port=5432 >> > user= password=xx'); > If I may be permitted a rant at

Re: [GENERAL] Unable to connect to Postgresql

2017-04-09 Thread Joe Conway
On 04/09/2017 11:33 AM, John Iliffe wrote: > On Saturday 08 April 2017 18:10:35 Joe Conway wrote: >> On 04/08/2017 01:23 PM, John Iliffe wrote: >> > On Saturday 08 April 2017 09:38:07 Adrian Klaver wrote: >> >> So what if you change the connection to use -h localh

Re: [GENERAL] Unable to connect to Postgresql

2017-04-08 Thread Joe Conway
ot;5432" 8<- That will try to use a tcp connection on localhost instead of a unix socket. Another question I don't believe has been asked is, what does your pg_hba.conf look like? Joe -- Crunchy Data - http://crunchydata.com PostgreSQL Support for Secure Enterprises Consul

Re: [GENERAL] Unable to connect to Postgresql

2017-04-08 Thread Joe Conway
On 04/08/2017 06:31 AM, John Iliffe wrote: > On Saturday 08 April 2017 00:10:14 Adrian Klaver wrote: >> On 04/07/2017 07:45 PM, Joe Conway wrote: >> > On 04/07/2017 05:35 PM, Adrian Klaver wrote: >> >> On 04/07/2017 05:03 PM, John Iliffe wrote: >> >&g

Re: [GENERAL] Unable to connect to Postgresql

2017-04-07 Thread Joe Conway
ch file or directory\n\tIs the server running >> locally and >> accepting\n\tconnections on Unix domain socket >> "/tmp/.s.PGSQL.5432"? in /httpd/iliffe/testfcgi.php on line >> 121 This might be a silly question, but is PHP running on

Re: [GENERAL] PostgreSQL and Kubernetes

2017-04-03 Thread Joe Conway
about to test it too), but while this is in > beta I need a solution to keep up with my architecture... I can't stay > with a single server and no backup (except a snapshot of the disk made > on a daily basis... but that's no real backup) waiting for Cloud SQL to >

Re: [GENERAL] Conferences for a DBA?

2017-02-27 Thread Joe Conway
y talk slide-decks: https://wiki.postgresql.org/wiki/PostgreSQL_Related_Slides_and_Presentations HTH, Joe -- Crunchy Data - http://crunchydata.com PostgreSQL Support for Secure Enterprises Consulting, Training, & Open Source Development signature.asc Description: OpenPGP digital signature

Re: [GENERAL] Recursive row level security policy

2016-12-17 Thread Joe Conway
On 12/17/2016 02:04 PM, Stephen Frost wrote: > Note that RLS won't be applied for the table owner either (unless the > relation has 'FORCE RLS' enabled for it), so you don't have to have > functions which are run as superuser to use the approach Joe > recommende

Re: [GENERAL] Recursive row level security policy

2016-12-17 Thread Joe Conway
On 12/17/2016 01:01 PM, Simon Charette wrote: > Thanks a lot Joe, that seems to work! Good to hear. > I suppose this works because PostgreSQL cannot introspect the > get_owner_id procedure to detect it's querying the "accounts" table > and thus doesn't warn a

Re: [GENERAL] Recursive row level security policy

2016-12-16 Thread Joe Conway
T STABLE SECURITY DEFINER; CREATE POLICY account_ownership ON accounts FOR SELECT USING (owner_id = get_owner_id(current_user)); CREATE ROLE foo; SET ROLE foo; SELECT * FROM accounts; id | name | owner_id +--+-- 1 | foo |1 2 | bar |1 (2 rows) 8<

Re: [GENERAL] Backup "Best Practices"

2016-11-23 Thread Joe Conway
something to try. Thanks! I'd recommend you also look at pgbackrest: https://github.com/pgbackrest/pgbackrest HTH, Joe -- Crunchy Data - http://crunchydata.com PostgreSQL Support for Secure Enterprises Consulting, Training, & Open Source Development signature.asc Description: OpenPGP digital signature

Re: [GENERAL] Uber migrated from Postgres to MySQL

2016-07-28 Thread Joe Conway
o find the patch that fixed a good bit of the slowness and backport it to the older version so we could successfully run pg_upgrade (in something like 14 hours instead of 7+ days). Joe -- Crunchy Data - http://crunchydata.com PostgreSQL Support for Secure Enterprises Consulting, Training, & Open Source Development signature.asc Description: OpenPGP digital signature

Re: [GENERAL] CStringGetTextDatum and other conversions in server-side code

2016-03-02 Thread Joe Conway
ter answer than before: grep and/or read source for other PLs. FWIW here are examples from PL/R for incoming (argument) and outgoing (result) conversions of scalar values: https://github.com/jconway/plr/blob/master/pg_conversion.c#L632 https://github.com/jconway/plr/blob/master/pg_conversion.c#L100

Re: [GENERAL] CStringGetTextDatum and other conversions in server-side code

2016-03-02 Thread Joe Conway
end can be used by your PL. There is not a lot of documentation other than in the source code itself. Look at examples, see what they do, emulate it. HTH, Joe -- Crunchy Data - http://crunchydata.com PostgreSQL Support for Secure Enterprises Consulting, Training, & Open Source Development

Re: [GENERAL] RLS on catalog tables would be helpful

2016-03-02 Thread Joe Conway
On 03/02/2016 12:14 PM, Julien Rouhaud wrote: > On 02/03/2016 20:56, Joe Conway wrote: >> I thought there was once a link somewhere on the mail archives to get a >> specific email resent, but for the life of me I cannot find it today :-/ >> > > It's only available

Re: [GENERAL] RLS on catalog tables would be helpful

2016-03-02 Thread Joe Conway
On 03/02/2016 11:53 AM, Joshua D. Drake wrote: > On 03/02/2016 11:37 AM, Joe Conway wrote: > >> http://www.postgresql.org/message-id/flat/CA+Tgmoa=4vti1hb1hta0+qbzlojkpjbd5dkvw3zmp-kdwje...@mail.gmail.com#CA+Tgmoa=4vti1hb1hta0+qbzlojkpjbd5dkvw3zmp-kdwje...@mail.gmail.com >> &

Re: [GENERAL] RLS on catalog tables would be helpful

2016-03-02 Thread Joe Conway
d require to that thread. Joe -- Crunchy Data - http://crunchydata.com PostgreSQL Support for Secure Enterprises Consulting, Training, & Open Source Development signature.asc Description: OpenPGP digital signature

Re: [GENERAL] Privileges granted on dblink extension function do not survive database dump and restore

2016-02-26 Thread Joe Conway
itrary queries, just one very specific one. See http://www.postgresql.org/docs/9.5/interactive/sql-createfunction.html HTH, Joe -- Crunchy Data - http://crunchydata.com PostgreSQL Support for Secure Enterprises Consulting, Training, & Open Source Development signature.asc Description: OpenPGP digital signature

Re: [GENERAL] Privileges granted on dblink extension function do not survive database dump and restore

2016-02-25 Thread Joe Conway
ed definition will not be dumped by pg_dump. Such a change is usually only sensible if you concurrently make the same change in the extension's script file." Joe -- Crunchy Data - http://crunchydata.com PostgreSQL Support for Secure Enterprises Consulting, Training, & Open Source Development signature.asc Description: OpenPGP digital signature

Re: [GENERAL] Failing to known state

2016-01-05 Thread Joe Conway
, the next query will return an > error like CONNECTION_BAD. there's no possible privilege elevation. +1 I think you can call this one "Applicable -- Inherently Meets" Joe -- Crunchy Data - http://crunchydata.com PostgreSQL Support for Secure Enterprises Consulting, Training, & Open Source Development signature.asc Description: OpenPGP digital signature

Re: [GENERAL] Efficiently Triggering Autovacuum Analyze?

2015-12-30 Thread Joe Conway
y will finish quickly and have minimal impact. HTH, Joe -- Crunchy Data - http://crunchydata.com PostgreSQL Support for Secure Enterprises Consulting, Training, & Open Source Development signature.asc Description: OpenPGP digital signature

Re: [GENERAL] Fwd: dblink_connect fails

2015-12-16 Thread Joe Conway
On 12/16/2015 06:10 PM, James Sewell wrote: > Oops left off the list. Me too -- response repeated below... > -- Forwarded message -- > From: *James Sewell* <mailto:james.sew...@lisasoft.com>> > Date: Thursday, 17 December 2015 > Subject: dblink_connec

Re: [GENERAL] dblink_connect fails

2015-12-16 Thread Joe Conway
On 12/16/2015 04:53 PM, James Sewell wrote: > No it is not. > > Just in case I tried setting it to 'postgres', logged in without -U > (doesn't work without PGUSER set) and tried the operation again. > > DETAIL: FATAL: role "PRDSWIDEGRID01$" does not exist That "PRDSWIDEGRID01$" is comi

Re: [GENERAL] dblink_connect fails

2015-12-15 Thread Joe Conway
ironment as seen by the OS user the postmaster runs under)? See: http://www.postgresql.org/docs/9.4/static/libpq-envars.html Joe -- Crunchy Data - http://crunchydata.com PostgreSQL Support for Secure Enterprises Consulting, Training, & Open Source Development signature.asc Description: OpenPGP digital signature

Re: [GENERAL] Unable to select a table as postgres user

2015-10-30 Thread Joe Conway
On 10/30/2015 10:27 AM, rajan wrote: > The function is created as postgres user. > > And I get a permission denied error. If you want help solving this, I suggest you post a minimal, self contained test case (i.e. SQL statements) which anyone can run to reproduce your issue.

Re: [GENERAL] Configure with Openssl fails

2015-10-21 Thread Joe Conway
y ideas...? Just a guess, but if indeed ssl.h is located in /usr/local/ssl/include/openssl based on the error message I would try: --with-includes=/usr/local/ssl/include HTH, Joe -- Crunchy Data - http://crunchydata.com PostgreSQL Support for Secure Enterprises Consulting, Training, &am

Re: [GENERAL] postgres function

2015-10-15 Thread Joe Conway
27;ll find > direct for second variable we don't know where it's end with - > > i.e , > i need to find second postition of the variable between the '-' Are you looking for the position or the actual variable? If you really want the latter you can do: select spl

Re: [GENERAL] Very puzzling sort behavior

2015-09-10 Thread Joe Conway
ly, but isn't this what you want? 8<--- create table t2(a text); insert into t2 values('abc,def'),('abcd'); show lc_collate; lc_collate - en_US.UTF-8 (1 row) select a from t2 order by a; a - abcd abc,def (2 rows) select a from t2 or

Re: [GENERAL] How to analyze a slowdown in 9.3.5?

2015-01-12 Thread Joe Van Dyk
rgest tables after the first DB shutdown. > One thing to check (I ran into this two weeks ago) -- even though vacuums were happening, a query running on a standby machine was preventing the vacuum process from removing the dead rows. You may want to check for bloat or use 'vacuum verbose' to see if there's many dead rows not being cleaned up. Joe

[GENERAL] 9.3.6 release?

2014-12-29 Thread Joe Van Dyk
Hi, Any estimates on when 9.3.6 will be released? We've been running off 9-3-stable for the past five months, as there's some fixes in there that we need. Thanks, Joe

Re: [GENERAL] some queries on standby preventing replication updates

2014-10-28 Thread Joe Van Dyk
On Mon, Oct 27, 2014 at 6:22 AM, Emanuel Calvo < emanuel.ca...@2ndquadrant.com> wrote: > > El 23/10/14 a las 17:40, Joe Van Dyk escibió: > > Hi, > > > > I have a master and a slave database. > > > > I've got hot_standby_feedback turned on, > >

Re: [GENERAL] pg killed by oom-killer, "invalid contrecord length 2190 at A6C/331AAA90" on slaves

2014-10-28 Thread Joe Van Dyk
On Tue, Oct 28, 2014 at 7:43 AM, Andres Freund wrote: > On 2014-10-25 13:55:57 -0700, Joe Van Dyk wrote: > > One of my postgres backends was killed by the oom-killer. Now, one of my > > streaming replication slaves is reporting "invalid contrecord length 2190 > > at A6C

Re: [GENERAL] pg killed by oom-killer, "invalid contrecord length 2190 at A6C/331AAA90" on slaves

2014-10-27 Thread Joe Van Dyk
bout the oom killer, but rather about why just one of the slaves is reporting the "invalid contrecord length" error. > I hope that's helpful. > > Regards, > basti > > On Sat 25.10.2014 22:55 +0200, Joe Van Dyk wrote: > > One of my postgres backends was killed by

[GENERAL] pg killed by oom-killer, "invalid contrecord length 2190 at A6C/331AAA90" on slaves

2014-10-25 Thread Joe Van Dyk
lave that works is in the same data center as the master -- not sure if that's related at all. Joe

Re: [GENERAL] Finding date intersections

2014-10-25 Thread Joe Van Dyk
ld use a LEFT JOIN with itself: > > WITH RECURSIVE explode(times) AS ( > SELECT times > FROM sales > UNION > SELECT a.times + b.times > FROM explode a > JOIN sales b ON b.times && a.times OR b.times -|- a.times > ) > SELECT a.times > FROM explode a > LEFT JOIN explode b ON b.times @> a.times AND b.times != a.times > WHERE b.times IS NULL > ORDER BY a.times > Perfect! Thanks! Now I just need to understand how that works.. :) Joe

Re: [GENERAL] Finding date intersections

2014-10-24 Thread Joe Van Dyk
On Fri, Oct 24, 2014 at 11:02 AM, David G Johnston < david.g.johns...@gmail.com> wrote: > John McKown wrote > >> insert into sales values > >> (tstzrange('2014-1-1', '2014-1-2')), > >> (tstzrange('2014-1-2', '2014-1-3')), > >> (tstzrange('2014-1-2', '2014-1-4')), > >> (tstzrange('2014-1-5'

[GENERAL] Finding date intersections

2014-10-23 Thread Joe Van Dyk
nge('2014-1-2', '2014-1-3')), (tstzrange('2014-1-2', '2014-1-4')), (tstzrange('2014-1-5', '2014-1-6')); -- want back: -- tstzrange('2014-1-1', '2014-1-4') -- tstzrange('2014-1-6', '2014-1-6') Thanks, Joe

[GENERAL] some queries on standby preventing replication updates

2014-10-23 Thread Joe Van Dyk
e than a minute or so), replication updates are paused. Is there a way to fix this? Thanks, Joe

Re: [GENERAL] Any experiences running PostgreSQL 9.3.5 on compressed Btrfs on Linux?

2014-09-13 Thread Joe Conway
pful" http://no0p.github.io/postgresql/2014/09/06/benchmarking-postgresql-btrfs-zlib.html Joe - -- Joe Conway credativ LLC: http://www.credativ.us Linux, PostgreSQL, and general Open Source Training, Service, Consulting, & 24x7 Support -BEGIN PGP SIGNATURE---

Re: [GENERAL] jsonb and comparison operators

2014-09-02 Thread Joe Van Dyk
On Tue, Sep 2, 2014 at 9:55 PM, Peter Geoghegan wrote: > On Tue, Sep 2, 2014 at 9:38 PM, Joe Van Dyk wrote: > > I want to return all rows that have a value of less than 10. I have > > arbitrary keys I want to check (not just 'a'). > > > If you created an expre

[GENERAL] jsonb and comparison operators

2014-09-02 Thread Joe Van Dyk
Is it possible to get this query (or a similar one) to use an index? I want to return all rows that have a value of less than 10. I have arbitrary keys I want to check (not just 'a'). drop table if exists test; create table test (j jsonb); insert into test select json_build_object('a', i)::json

Re: [GENERAL] adding a nullable column of type domain w/ check constraint runs checks?

2014-09-02 Thread Joe Van Dyk
On Tue, Aug 19, 2014 at 3:20 PM, Joe Van Dyk wrote: > On Tue, Aug 19, 2014 at 3:16 PM, Joe Van Dyk wrote: > >> On Tue, Aug 19, 2014 at 3:10 PM, Joe Van Dyk wrote: >> >>> I have a large table that I don't want to lock for more than couple >>> second

Re: [GENERAL] adding a nullable column of type domain w/ check constraint runs checks?

2014-08-19 Thread Joe Van Dyk
On Tue, Aug 19, 2014 at 3:16 PM, Joe Van Dyk wrote: > On Tue, Aug 19, 2014 at 3:10 PM, Joe Van Dyk wrote: > >> I have a large table that I don't want to lock for more than couple >> seconds. I want to add a nullable column to the table, the type of the >> co

Re: [GENERAL] adding a nullable column of type domain w/ check constraint runs checks?

2014-08-19 Thread Joe Van Dyk
On Tue, Aug 19, 2014 at 3:10 PM, Joe Van Dyk wrote: > I have a large table that I don't want to lock for more than couple > seconds. I want to add a nullable column to the table, the type of the > column is a domain with a check constraint. > > It appears that the check

[GENERAL] adding a nullable column of type domain w/ check constraint runs checks?

2014-08-19 Thread Joe Van Dyk
I have a large table that I don't want to lock for more than couple seconds. I want to add a nullable column to the table, the type of the column is a domain with a check constraint. It appears that the check constraint is being checked for each row, even though the column can be nullable? Is ther

Re: [GENERAL] Pairwise array sum aggregate function?

2014-07-28 Thread Joe Conway
e = int[] ); select grp, pairwise_sum(a) from regres group by grp; grp | pairwise_sum - -+-- 1 | {14,16,19} 2 | {11,13,15} (2 rows) HTH, Joe - -- Joe Conway credativ LLC: http://www.credativ.us Linux, PostgreSQL, and general Open Source Training, Service, Consu

Re: [GENERAL] Do foreign key triggers get ran even if the key's value doesn't change?

2014-05-22 Thread Joe Van Dyk
On Thu, May 22, 2014 at 10:52 AM, Tom Lane wrote: > Jeff Janes writes: >> On Wed, May 21, 2014 at 7:48 PM, Joe Van Dyk wrote: >>> I was expecting that the RI update triggers would have a "when (new.key is >>> distinct from old.key)" condition on them, wh

Re: [GENERAL] Do foreign key triggers get ran even if the key's value doesn't change?

2014-05-21 Thread Joe Van Dyk
On Wednesday, May 21, 2014, Jeff Janes wrote: > > On Wed, May 21, 2014 at 1:11 PM, Joe Van Dyk > > > wrote: > >> I came across http://bonesmoses.org/2014/05/14/foreign-keys-are-not-free/ >> which seems to indicate so. >> >> When I run the following

[GENERAL] Do foreign key triggers get ran even if the key's value doesn't change?

2014-05-21 Thread Joe Van Dyk
I came across http://bonesmoses.org/2014/05/14/foreign-keys-are-not-free/ which seems to indicate so. When I run the following test script, having 50 foreign keys takes about twice as long to do the update. Is there a reason for that? Seems like the RI triggers wouldn't have to run on updates if t

[GENERAL] Adding a not null constraint faster

2014-05-17 Thread Joe Van Dyk
hout any significant downtime involves creating a new table, as I understand it. Joe -- 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] arrays of rows and dblink

2014-04-30 Thread Joe Conway
RE? ) select * from dblink('dbname=test',$$select array_agg(r) from (values (1::int, 'today'::timestamp, 'a'::text), (2, 'yesterday', 'b')) r(a,b,c)$$) as d(f text[]); f - --

Re: [GENERAL] Return and sql tuple descriptions are incompatible

2014-04-25 Thread Joe Conway
e,produkid, onhand from test order by 1,2', 'values (279140414),(279140421)' ) as ct (warehousename text, p_279140414 int, p_279140421 int); warehousename | p_279140414 | p_279140421 - -------+-+- OFFICE

Re: [GENERAL] Return and sql tuple descriptions are incompatible

2014-04-25 Thread Joe Conway
e the issue. In other words, help us help you. Joe - -- Joe Conway credativ LLC: http://www.credativ.us Linux, PostgreSQL, and general Open Source Training, Service, Consulting, & 24x7 Support -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.14 (GNU/Linux) Comment: Using GnuPG with Thu

Re: [GENERAL] SSD Drives

2014-04-03 Thread Joe Van Dyk
On Wed, Apr 2, 2014 at 12:37 PM, Bret Stern < bret_st...@machinemanagement.com> wrote: > Any opinions/comments on using SSD drives with postgresql? > Related, anyone have any thoughts on using postgresql on Amazon's EC2 SSDs? Been looking at http://aws.amazon.com/about-aws/whats-new/2013/12/19/a

Re: [GENERAL] Optimizing CartoDB's JenksBins function

2014-03-18 Thread Joe Conway
s is, do you see any > optimizations? Not exactly what you asked, but you might try PL/R with the R "classInt" package: http://cran.at.r-project.org/web/packages/classInt/classInt.pdf HTH, Joe - -- Joe Conway credativ LLC: http://www.credativ.us Linux, PostgreSQL, and general Open Sou

Re: [GENERAL] can't cast hstore to json

2014-03-13 Thread Joe Van Dyk
On Thu, Mar 13, 2014 at 12:15 PM, Joe Van Dyk wrote: > I've got a postgresql 9.3.2 server, compiled from scratch. Getting this > error: > > # select hstore('a', 'b')::json; > ERROR: cannot cast type hstore to json

[GENERAL] can't cast hstore to json

2014-03-13 Thread Joe Van Dyk
son(array[hstore('a', 'b')]); array_to_json -- ["\"a\"=>\"b\""] (1 row) (I expected [{"a": "b"}] ) I don't get this on other postgresql installations. Any ideas? Joe

Re: [GENERAL] How can I correctly handle sparse crosstabs?

2014-02-26 Thread Joe Conway
the examples about 2/3rds down the page. HTH, Joe - -- Joe Conway credativ LLC: http://www.credativ.us Linux, PostgreSQL, and general Open Source Training, Service, Consulting, & 24x7 Support -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.14 (GNU/Linux) Comment: Using GnuP

[GENERAL] roles inheriting configuration values

2014-02-07 Thread Joe Van Dyk
I'd like to have join_collapse_limit=20 for all users that belong to a certain group. Is there a way to do that without having to alter all the roles that are in that group? $ psql monkey psql (9.3.1) Type "help" for help. monkey=# create user f1 login; CREATE ROLE monkey=# create user f2 in role

Re: [GENERAL] levenshtein_less_equal does not work

2014-01-24 Thread Joe Conway
theory, can't say I have tried it extensively). But your method works too ;-) Joe - -- Joe Conway credativ LLC: http://www.credativ.us Linux, PostgreSQL, and general Open Source Training, Service, Consulting, & 24x7 Support -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.14 (GNU/Linux) C

Re: [GENERAL] levenshtein_less_equal does not work

2014-01-24 Thread Joe Conway
fuzzystrmatch | 1.0 | public | determine similarities and distance between strings plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language (2 rows) Joe - -- Joe Conway credativ LLC: http://www.credativ.us Linux, PostgreSQL, and general Open Source

Re: [GENERAL] levenshtein_less_equal does not work

2014-01-24 Thread Joe Conway
4-bit" > > routing_nw2=# \df levenshtein_less_equal List of functions Schema > | Name | Result data type | Argument data types | Type > +--+--+-+-- (0 > rows) > > routing_nw2=# Hmm, can we see: \dx and \df

Re: [GENERAL] levenshtein_less_equal does not work

2014-01-24 Thread Joe Conway
3 (1 row) 8<- We need more specific info about how you obtained and installed the extension. Joe - -- Joe Conway credativ LLC: http://www.credativ.us Linux, PostgreSQL, and general Open Source Training, Service, Consulting, & 24x7

Re: [GENERAL] levenshtein_less_equal does not work

2014-01-24 Thread Joe Conway
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/24/2014 12:50 PM, alexandros_e wrote: > For some reason levenshtein_less_equal does not work, Define "does not work", i.e. cut and paste exact SQL and output so we can see and reproduce your issue. Joe - -- Joe Conway creda

Re: [GENERAL] Is there a way to return "true"/"false" string for boolean type?

2014-01-07 Thread Joe Van Dyk
On Tue, Jan 7, 2014 at 10:11 AM, ChoonSoo Park wrote: > Hello Gurus, > > I have several tables with lots of boolean columns. > When I run select query for the tables, I always get 't' or 'f' for > boolean types. > > Is there a way to return 'true' or 'false' string for boolean type except > using

Re: [GENERAL] When starting postgres, it hangs like it is still connected to stdout

2014-01-07 Thread Joe Van Dyk
On Tue, Jan 7, 2014 at 11:47 AM, Susan Cassidy < susan.cass...@decisionsciencescorp.com> wrote: > When I start postgres using postgres -D $PGDATA, it hangs, and I see that > postgres and all the other attendant processes are running, but I never get > my prompt back. > > If I hit ctl/C, postgres e

Re: [GENERAL] Is there a way to return "true"/"false" string for boolean type?

2014-01-07 Thread Joe Van Dyk
egards, >> Szymon >> > > In the custom stored function, I'm returning a resultset using hstore > function. > RETURN QUERY SELECT a few other columns, hstore(t.*) FROM table t WHERE > condition. > > I don't want to change it to > > SELECT a few other columns, hstore('c1', CAST(t.c1 AS TEXT)) || > hstore('c2', CAST(t.c2 AS TEXT)) || ...hstore('cn', t.cn::text) || ... > FROM table t WHERE condition. > Can you use json instead of hstore? # select * from test; id | b +--- 1 | t 2 | f # select to_json(test) from test; to_json {"id":1,"b":true} {"id":2,"b":false} Joe

Re: [GENERAL] Replication failed after stalling

2013-12-30 Thread Joe Van Dyk
On Mon, Dec 30, 2013 at 9:11 PM, Sergey Konoplev wrote: > On Mon, Dec 30, 2013 at 8:56 PM, Joe Van Dyk wrote: > > On Mon, Dec 30, 2013 at 10:27 AM, Sergey Konoplev > wrote: > >> On Mon, Dec 30, 2013 at 12:02 AM, Joe Van Dyk wrote: > >> > On Sun, Dec 29,

Re: [GENERAL] Replication failed after stalling

2013-12-30 Thread Joe Van Dyk
On Mon, Dec 30, 2013 at 10:27 AM, Sergey Konoplev wrote: > On Mon, Dec 30, 2013 at 12:02 AM, Joe Van Dyk wrote: > > On Sun, Dec 29, 2013 at 10:52 PM, Sergey Konoplev > wrote: > >> On Sun, Dec 29, 2013 at 9:56 PM, Joe Van Dyk wrote: > >> > On Wed, Dec 18,

Re: [GENERAL] Replication failed after stalling

2013-12-29 Thread Joe Van Dyk
On Wed, Dec 18, 2013 at 3:39 PM, Sergey Konoplev wrote: > On Wed, Dec 18, 2013 at 11:26 AM, Joe Van Dyk wrote: > > I'm running Postgresql 9.3. I have a streaming replication server. > Someone > > was running a long COPY query (8 hours) on the standby which halt

Re: [GENERAL] to_json(now()) result doesn't have 'T' separator

2013-12-23 Thread Joe Van Dyk
w()); insert into t values (default); select row_to_json(t) from t; row_to_json --- {"id":1,"created_at":"2013-12-23 17:37:08.825935-08"} On Mon, Dec 23, 2013 at 5:28 PM, Joe Van Dyk wro

Re: [GENERAL] to_json(now()) result doesn't have 'T' separator

2013-12-23 Thread Joe Van Dyk
ay to easily let javascript applications parse json timestamps generated by postgresql in row_to_json() statements. On Fri, Dec 20, 2013 at 6:27 PM, Joe Van Dyk wrote: > On Fri, Dec 20, 2013 at 4:24 PM, Joe Van Dyk wrote: > >> >> >> On Fri, Dec 20, 2013 at 4:18 PM, Joe Va

Re: [GENERAL] to_json(now()) result doesn't have 'T' separator

2013-12-20 Thread Joe Van Dyk
On Fri, Dec 20, 2013 at 4:24 PM, Joe Van Dyk wrote: > > > On Fri, Dec 20, 2013 at 4:18 PM, Joe Van Dyk wrote: > >> # select to_json(now()); >> to_json >> - >> "2013-12-20 15:53:39.098204-08" >> (1

Re: [GENERAL] to_json(now()) result doesn't have 'T' separator

2013-12-20 Thread Joe Van Dyk
On Fri, Dec 20, 2013 at 4:18 PM, Joe Van Dyk wrote: > # select to_json(now()); > to_json > - > "2013-12-20 15:53:39.098204-08" > (1 row) > > I'd like to see it output "2013-12-20T15:53:39.098204-08&quo

[GENERAL] to_json(now()) result doesn't have 'T' separator

2013-12-20 Thread Joe Van Dyk
own date format, but I'd really like to be able to use row_to_json and other functions without specifying custom date formats everywhere. Joe

Re: [GENERAL] Question(s) about crosstab

2013-12-18 Thread Joe Conway
On 12/18/2013 05:14 PM, John Abraham wrote: On Dec 18, 2013, at 3:52 PM, Joe Conway wrote: 3) Not possible -- reason was given down thread. Column definition must be known/determinable by the parser prior to query execution. No, wait, I think you misunderstood my idea. Can’t we have a

Re: [GENERAL] Question(s) about crosstab

2013-12-18 Thread Joe Conway
hat it didn't need the column definition list until query execution time, which I also doubt is possible. Joe -- Joe Conway credativ LLC: http://www.credativ.us Linux, PostgreSQL, and general Open Source Training, Service, Consulting, & 24x7 Support -- Sent via pgsql-general mailing li

Re: [GENERAL] Replication failed after stalling

2013-12-18 Thread Joe Van Dyk
) On Wed, Dec 18, 2013 at 11:26 AM, Joe Van Dyk wrote: > I'm running Postgresql 9.3. I have a streaming replication server. Someone > was running a long COPY query (8 hours) on the standby which halted > replication. The replication stopped at 3:30 am. I canceled the > long-r

[GENERAL] Replication failed after stalling

2013-12-18 Thread Joe Van Dyk
a from 3:30 am to 10 am, then start complaining about missing WAL files. What's the best way to avoid this problem? Increase wal_keep_segments? Joe

Re: [GENERAL] Changing function from SECURITY DEFINER to SECURITY INVOKER changes query plan?

2013-11-21 Thread Joe Van Dyk
On Thu, Nov 21, 2013 at 6:11 PM, Tom Lane wrote: > Joe Van Dyk writes: > > I had a function that was set to SECURITY INVOKER. I needed to give > access > > to a view that uses this function to a role, so I made the function > > SECURITY DEFINER. > > > The

[GENERAL] Changing function from SECURITY DEFINER to SECURITY INVOKER changes query plan?

2013-11-21 Thread Joe Van Dyk
I had a function that was set to SECURITY INVOKER. I needed to give access to a view that uses this function to a role, so I made the function SECURITY DEFINER. The function is STABLE and is usually inlined and takes 2 ms to run. Immediately, the function quit being inlined and took 1500ms to run

[GENERAL] Report the trigger name when complaining about "tuple to be updated was already modified by an operation triggered by the current command"?

2013-10-21 Thread Joe Van Dyk
there be? (I fixed the error by moving the before trigger to an after one.) Joe

Re: [GENERAL] Using PL/R with 9.3beta2

2013-09-15 Thread Joe Conway
latest code from github, which works fine with 9.3: https://github.com/jconway/plr Joe - -- Joe Conway credativ LLC: http://www.credativ.us Linux, PostgreSQL, and general Open Source Training, Service, Consulting, & 24x7 Support -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.12 (GNU

Re: [GENERAL] uuids with btree_gist

2013-09-03 Thread Joe Van Dyk
On Tue, Sep 3, 2013 at 1:41 PM, Martin Renters wrote: > I'm trying to use timestamp ranges to keep track of the values particular > items had over time, but I'm unable to create a table as follows: > > test=# create extension btree_gist; > CREATE EXTENSION > test=# create table v(item uuid, lifet

[GENERAL] Why doesn't COPY support the HEADER options for tab-separated output?

2013-08-12 Thread Joe Van Dyk
Mostly just curious, as this is preventing me from using tab-separated output. I'd like there to be a header in my files. I have to use CSVs instead. Joe

[GENERAL] Adding ip4r to Postgresql core?

2013-08-07 Thread Joe Van Dyk
Hi, Any chance ip4r could be an official postgresql extension? It's got a lot of advantages over the existing cidr/inet stuff. https://github.com/RhodiumToad/ip4r-historical/blob/master/README.ip4r Joe

Re: [GENERAL] casting tsrange to tstzrange doesn't seem to work?

2013-07-26 Thread Joe Van Dyk
On Friday, July 5, 2013, Jeff Davis wrote: > On Tue, 2013-06-11 at 14:05 -0700, Joe Van Dyk wrote: > > # select tsrange(null)::tstzrange; > > ERROR: cannot cast type tsrange to tstzrange > > LINE 1: select tsrange(null)::tstzrange; > > > I agree that there should

Re: [GENERAL] how _not_ to log?

2013-07-25 Thread Joe Van Dyk
On Thursday, July 25, 2013, Tim Spencer wrote: > Hello there! > > I've seen lots of people who have asked questions about how to log > this or that, but I have the opposite question! :-) I'm seeing this in my > logs: > > Jul 25 18:08:11 staging-db11 postgres[27050]: [10-2] STATEMENT: cr

Re: [GENERAL] cron tasks in pg 9.3

2013-07-18 Thread Joe Van Dyk
On Thu, Jul 18, 2013 at 2:31 PM, Thomas Kellerer wrote: > Joe Van Dyk wrote on 18.07.2013 23:23: > > Will the custom worker support in 9.3 let me put cron-like tasks into >> postgresql? >> >> I have a lot of database functions that should run every few seconds, >&g

  1   2   3   4   5   6   >