Re: [GENERAL] importing a messy text file

2014-04-30 Thread Rob Sargentg
On 04/30/2014 03:50 AM, Willy-Bas Loos wrote: On Wed, Apr 30, 2014 at 11:06 AM, Rémi Cura remi.c...@gmail.com mailto:remi.c...@gmail.com wrote: with latest version 9.3 you can use a copy from with a programm as argument. You can use the unix | pipe for most of the stuff. If

Re: [GENERAL] Altering array(composite-types) without breaking code when inserting them and similar questions

2014-04-20 Thread Rob Sargentg
Sorry, I should not have top-posted (Dang iPhone). Continued below: On 04/20/2014 05:54 PM, Dorian Hoxha wrote: Because i always query the whole row, and in the other way(many tables) i will always join + have other indexes. On Sun, Apr 20, 2014 at 8:56 PM, Rob Sargent robjsarg...@gmail.com

Re: [GENERAL] How to evaluate if a query is correct?

2013-09-19 Thread Rob Sargentg
On 09/19/2013 12:13 AM, Juan Daniel Santana Rodés wrote: Hi my friends... I wrote in the last post a question similiar to this. But in this post I clarify better the previous question. I need know how to evaluated if a query is correct without execute it. When I say if a query is correct, is

Re: [GENERAL] Sum of columns

2013-09-08 Thread Rob Sargentg
On 09/08/2013 07:12 PM, jane...@web.de wrote: Hi, this is my query: SELECT user, sum(CASE WHEN lev = 50 AND lev 70 THEN 1 ELSE 0 END) as a, sum(CASE WHEN lev = 70 AND lev 80 THEN 1 ELSE 0 END) as b, sum(CASE WHEN lev = 80 AND lev = 90 THEN 1 ELSE 0 END) as c,

Re: [GENERAL] SQL Path in psql

2013-09-06 Thread Rob Sargentg
On 09/06/2013 11:05 AM, miles wrote: Bobby Dewitt wrote I come from an Oracle background and I am fairly new to Postgres. Oracle's command line utility (SQL*Plus) uses an environment variable called SQLPATH to search the given directories for SQL scripts that the user calls to execute using a

Re: [GENERAL] earthdistance

2013-08-10 Thread Rob Sargentg
I just recently built the postgis stack (unbuntu 12.4) and had to go to the trunk (maybe 2.1) for postgis itself for a work-around a dependency failure on, ircc, geos. rjs On 08/10/2013 04:03 PM, Brent Wood wrote: Is there not a precompiled Postgis package you can use? There are a few

Re: [GENERAL] regexp_replace failing on 9.0.4

2013-03-18 Thread Rob Sargentg
Maybe we're barking up the wrong tree by suspecting the regex itself. Perhaps the updates were suppressed by a trigger, or the transaction rolled back instead of committing, or some such? regards, tom lane Barking mad, more like it. I had rolled back the execution of

Re: [GENERAL] psql copy from through bash

2013-01-11 Thread Rob Sargentg
On 01/11/2013 11:32 AM, Kirk Wythers wrote: On Jan 11, 2013, at 12:18 PM, Szymon Guz mabew...@gmail.com mailto:mabew...@gmail.com wrote: On 11 January 2013 19:13, Kirk Wythers kwyth...@umn.edu mailto:kwyth...@umn.edu wrote: Can anyone see what I'm misisng? I am trying to run a

Re: [GENERAL] Is EXISTS the most efficient approach for PostgreSql to check for existence of nodes in a tree?

2012-05-17 Thread Rob Sargentg
On 05/17/2012 03:06 AM, Seref Arikan wrote: I have a key value table in my Postgresql db, which represents hierarchical data through parent_feature_mapping column that points to id of feature_mapping_id column of the same table. I need to select root nodes that has children which satisfy

Re: [GENERAL] Bug? Query plans / EXPLAIN using gigabytes of memory

2012-04-29 Thread Rob Sargentg
On 04/29/2012 07:19 PM, Toby Corkindale wrote: On 27/04/12 09:33, Tom Lane wrote: Toby Corkindaletoby.corkind...@strategicdata.com.au writes: I've created a bit of a test case now. There's a Perl script here: http://dryft.net/postgres/ AFAICT, what is happening is that we're repeating the

Re: [GENERAL] Unfamous 'could not read block ... in file ...: read only 0 of 8192 bytes' again

2012-02-20 Thread Rob Sargentg
On 02/20/2012 07:46 PM, Maxim Boguk wrote: On Tue, Feb 21, 2012 at 1:37 PM, Tom Lane t...@sss.pgh.pa.us mailto:t...@sss.pgh.pa.us wrote: Maxim Boguk maxim.bo...@gmail.com mailto:maxim.bo...@gmail.com writes: Do you know why the mod date on the file is 2012-02-20 12:04?

Re: [GENERAL] Appending a newline to a column value - in a psql cronjob

2012-01-13 Thread Rob Sargentg
On 01/13/2012 05:11 AM, Alexander Farber wrote: Hello! I'm using PostgreSQL 8.4.9 on CentOS 6.2 and with bash. The following cronjob works well for me (trying to send a mail to myself - for moderation): 6 6 * * * psql -c select 'http://mysite/user.php?id=' ||id,

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

2012-01-01 Thread Rob Sargentg
On 01/01/2012 11:51 AM, Jay Levitt wrote: revoke connect on database rails_dev from public; select pg_terminate_backend(procpid) from pg_stat_activity where datname='rails_dev'; Still, the app can reconnect. (So can psql.) So... 1. How can I prevent (or redirect, or timeout, or anything)

[GENERAL] reading build config.log -- possible bug?

2011-11-27 Thread Rob Sargentg
Looking to see where my new data directory is in recently built 9.1 I happened upon what could potentially be a bug in configure: Just after the line which begins configure_args= (line 11068 for me, 99% of buffer) I find: datadir='${datarootdir}' datarootdir='${prefix}/share' I'm troubled

Re: [GENERAL] reading build config.log -- possible bug?

2011-11-27 Thread Rob Sargentg
On 11/27/2011 09:31 PM, Tom Lane wrote: Rob Sargentgrobjsarg...@gmail.com writes: Looking to see where my new data directory is in recently built 9.1 I happened upon what could potentially be a bug in configure: Just after the line which begins configure_args= (line 11068 for me, 99% of

[GENERAL] 9.1.1 build failure : postgres link fails

2011-11-20 Thread Rob Sargentg
I just got round to updating my laptop to ubuntu-10.4 (32bit), in part because I kept hitting snags while trying to configure postgres 9.1.1. The upgrade did in fact solve the dependency issues (though I was surprised UUID came along with out the ossp specific impl??) but the build is having

Re: [GENERAL] 9.1.1 build failure : postgres link fails

2011-11-20 Thread Rob Sargentg
On 11/20/2011 11:05 AM, Tom Lane wrote: Rob Sargentrobjsarg...@gmail.com writes: On 11/20/2011 09:24 AM, Tom Lane wrote: It appears that on Ubuntu, libbsd defines those symbols, which confuses configure into supposing that they're provided by libc, and then the link fails because libbsd isn't