Re: [GENERAL] "could not split GIN page; no new items fit"

2015-04-04 Thread Chris Curvey
On Fri, Apr 3, 2015 at 9:27 PM, Tom Lane wrote: > Chris Curvey writes: > > Hmm, I'm trying to create a gin index, thusly: > > create index foo_idx on foo using gin(entry gin_trgm_ops); > > > and I'm getting the error "could not split GIN page; no new it

[GENERAL] "could not split GIN page; no new items fit"

2015-04-03 Thread Chris Curvey
Hmm, I'm trying to create a gin index, thusly: create index foo_idx on foo using gin(entry gin_trgm_ops); and I'm getting the error "could not split GIN page; no new items fit" Any idea what this means, or how I can get around it? The table in question has about 23MM rows, if that makes any dif

Re: [GENERAL] dump/restore with a hidden dependency?

2014-08-07 Thread Chris Curvey
> -Original Message- > From: Tom Lane [mailto:t...@sss.pgh.pa.us] > Sent: Thursday, August 07, 2014 2:50 PM > To: Chris Curvey > Cc: pgsql-general@postgresql.org > Subject: Re: [GENERAL] dump/restore with a hidden dependency? > > Chris Curvey writes: > &

Re: [GENERAL] dump/restore with a hidden dependency?

2014-08-07 Thread Chris Curvey
> -Original Message- > From: Shaun Thomas [mailto:stho...@optionshouse.com] > Sent: Thursday, August 07, 2014 12:43 PM > To: Chris Curvey; pgsql-general@postgresql.org > Subject: Re: [GENERAL] dump/restore with a hidden dependency? > > On 08/07/2014 10:00 A

[GENERAL] dump/restore with a hidden dependency?

2014-08-07 Thread Chris Curvey
I have a database with the following structure: Create table bar... Create function subset_of_bar ... (which does a select on a subset of "bar") Create table foo... Alter table foo add constraint mycheck check subset_of_bar(id); I pg_dumped my database, and tried to pg_restore it on another serve

Re: [GENERAL] Inconsistent results postgresql

2014-07-30 Thread Chris Curvey
On Wed, Jul 30, 2014 at 8:41 PM, Emir Ibrahimbegovic < emir.ibrahimbego...@gmail.com> wrote: > Hello all, > > I've got two queries which should produce the same results but they don't > for some reason, please consider these : > > SELECT date_trunc('day', payments.created_at) "day", SUM("payments"

Re: [GENERAL] converting a N rows table to a 1 row table ?

2014-07-03 Thread Chris Curvey
On Thu, Jul 3, 2014 at 8:30 AM, Arup Rakshit wrote: > Hi, > > One query is producing the below table :- > > answer | count | avg > a1 3 14 > a2 2 10 > > How to convert this to a single row table ? > > count | avg_a1 | avg_a2 > 5 14 10 > > Regards,

Re: [GENERAL] Approach to Data Summary and Analysis

2014-04-15 Thread Chris Curvey
On Tue, Apr 15, 2014 at 10:56 AM, Chris Curvey wrote: > On Mon, Apr 14, 2014 at 12:27 PM, Robert DiFalco > wrote: > >> I have several related tables that represent a call state. Let's think of >> these as phone calls to simplify things. Sometimes I need to determine t

Re: [GENERAL] Approach to Data Summary and Analysis

2014-04-15 Thread Chris Curvey
On Mon, Apr 14, 2014 at 12:27 PM, Robert DiFalco wrote: > I have several related tables that represent a call state. Let's think of > these as phone calls to simplify things. Sometimes I need to determine the > last time a user was called, the last time a user answered a call, or the > last time a

Re: [GENERAL] Problem with query

2014-04-11 Thread Chris Curvey
On Fri, Apr 11, 2014 at 1:50 PM, Susan Cassidy < susan.cass...@decisionsciencescorp.com> wrote: > I have a query with several joins, where I am searching for specific data > in certain columns. If I do this: > > SELECT distinct on (s.description, st1.description, s.scene_id) > s.description, s.sc

Re: [GENERAL] Synchronizing a table that is in two different databases : Need to dump a table as inserts from db1 and change the insert statements into UPDATE statements

2014-03-28 Thread Chris Curvey
a I got > from db1) > > > > *From:* ccur...@gmail.com [mailto:ccur...@gmail.com] *On Behalf Of *Chris > Curvey > *Sent:* Friday, March 28, 2014 1:50 PM > *To:* Khangelani Gama > *Cc:* pgsql > *Subject:* Re: [GENERAL] Synchronizing a table that is in two different > datab

Re: [GENERAL] Synchronizing a table that is in two different databases : Need to dump a table as inserts from db1 and change the insert statements into UPDATE statements

2014-03-28 Thread Chris Curvey
On Fri, Mar 28, 2014 at 5:56 AM, Khangelani Gama wrote: > Hi Chris or anyone who can help > > > > When I try this just below, it complains about foo , saying "ERROR: > schema "foo" does not exist." I got stuck on this error for a while now > but still trying to see why but still no luck so far. I

Re: [GENERAL] Synchronizing a table that is two different databases : Need to dump a table a insert from db1 and change the insert statements into UPDATE statements

2014-03-27 Thread Chris Curvey
On Thu, Mar 27, 2014 at 6:16 AM, Khangelani Gama wrote: > Hi all > > > > Synchronizing a *table* that is in two different databases(e.g *db1 and > db2*). > > > > Please help me with this. I need to dump a table as INSERTS from db1 > (postgres 9.1.2) and change the INSERT statements into UPDATE st

[GENERAL] windows binaries for FDW implementations?

2014-01-31 Thread Chris Curvey
Is there a trove of Windows installers for FDWs? I'd like to try a proof-of-concept with the ODBC_FDW. In the meantime, I'll try to go figure out how to go about building from source on windows, but if I can avoid that learning curve for my POC, that would be great. -Chris -- I asked the Inter

Re: [GENERAL] authentication failure

2014-01-03 Thread Chris Curvey
On Fri, Jan 3, 2014 at 4:16 AM, Jayadevan M wrote: > Hi, > I am trying to login from psql and consistently getting a > "psql: FATAL: password authentication failed for user "xyz"" for all > users. I am not being prompted for a password at all. I faced a similar > issue sometime ago because there

Re: [GENERAL] ON_ERROR_EXIT and interactive mode (or, how to force interactive mode off)

2013-12-27 Thread Chris Curvey
On Fri, Dec 27, 2013 at 7:30 AM, Tim Kane wrote: > HI all, > > I have a fairly complex python script which calls a number of ‘psql’ > sessions via a subprocess to perform bulk load operations. > The bulk loads are generated on the fly, and are written directly to the > stdin of the subprocess. >

[GENERAL] restore crashes PG on Linux, works on Windows

2013-11-26 Thread Chris Curvey
I'm working with a vendor who is in the process of converting their system from "something else" to Postgres. Yay! My vendor took a dump of our "something else" database (which runs on Windows), did their conversion to Postgres, and then sent me back a postgres dump (custom format) of the databas

Re: [GENERAL] Trouble installing psycopg2

2013-09-26 Thread Chris Curvey
On Thu, Sep 26, 2013 at 1:01 PM, Laura Tateosian wrote: > Hi, I'm trying to install psycopg2 on a Centos 5, 64-bit machine. I > have both 2.4 and 2.7 Python versions on this machine. I attempted to > install using > easy-install2.7 psycopg2 > > The install is not working. (I can't import psy

Re: [GENERAL] help getting a backtrace from 9.2 on Ubuntu 13.04?

2013-09-15 Thread Chris Curvey
On Sun, Sep 15, 2013 at 7:49 PM, Jeff Janes wrote: > On Tue, Sep 10, 2013 at 10:37 AM, Chris Curvey > wrote: > >> >> >> >> >> Great thought. Looking through the logs, it appears that all my failures >> are on a CREATE INDEX. Usually on my

Re: [GENERAL] problem with query

2013-09-12 Thread Chris Curvey
On Thu, Sep 12, 2013 at 5:33 PM, Roberto Scattini < roberto.scatt...@gmail.com> wrote: > > > On Thu, Sep 12, 2013 at 6:22 PM, Chris Curvey wrote: > >> >> >> On Thu, Sep 12, 2013 at 4:34 PM, Roberto Scattini < >> roberto.scatt...@gmail.com> wrote: &g

Re: [GENERAL] problem with query

2013-09-12 Thread Chris Curvey
On Thu, Sep 12, 2013 at 4:34 PM, Roberto Scattini < roberto.scatt...@gmail.com> wrote: > hi, today we discovered that this query doesn't return the expected values: > > SELECT DISTINCT > p.id, p.apellido AS "Apellido", p.nombre AS "Nombre", pf.nombre AS > "Funcion", to_char(da.f_ingreso_pg, 'dd/m

Re: [GENERAL] help getting a backtrace from 9.2 on Ubuntu 13.04?

2013-09-10 Thread Chris Curvey
From: Jeff Janes [mailto:jeff.ja...@gmail.com] Sent: Tuesday, September 10, 2013 1:26 PM To: Chris Curvey Cc: Marcin Mańk; pgsql-general@postgresql.org Subject: Re: [GENERAL] help getting a backtrace from 9.2 on Ubuntu 13.04? On Tue, Sep 10, 2013 at 6:57 AM, Chris Curvey mailto:ccur

Re: [GENERAL] help getting a backtrace from 9.2 on Ubuntu 13.04?

2013-09-10 Thread Chris Curvey
> > > > Good advice. I turned on –verbose, and got a ton of output, ending with: > > > > pg_restore: setting owner and privileges for FK CONSTRAINT > > user_id_refs_id_7ceef80f > > > > pg_restore: setting owner and privileges for FK CONSTRAINT > > user_id_refs_id_dfbab7d > > > > pg_restore: [archi

Re: [GENERAL] help getting a backtrace from 9.2 on Ubuntu 13.04?

2013-09-10 Thread Chris Curvey
From: Marcin Mańk [mailto:marcin.m...@gmail.com] Sent: Monday, September 09, 2013 8:30 PM To: Chris Curvey Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] help getting a backtrace from 9.2 on Ubuntu 13.04? On Mon, Sep 9, 2013 at 4:00 PM, Chris Curvey mailto:ccur...@zuckergoldberg.com

[GENERAL] help getting a backtrace from 9.2 on Ubuntu 13.04?

2013-09-09 Thread Chris Curvey
I have a production server running PG 8.4 on RHEL6. I have a development server running PG 9.2 on Ubuntu 13.04. Periodically, I like to take a dump of the production server and load it on the development machine. But I'm having troubles with the 9.2 server crashing when I'm restoring the dum

Re: [GENERAL] Sum of columns

2013-09-08 Thread Chris Curvey
does sum (case when lev >= 50 then 1 else 0 end) as matches do what you want? On Sun, Sep 8, 2013 at 9:12 PM, 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 E

Re: [GENERAL] Most efficient way to insert without duplicates

2013-04-17 Thread Chris Curvey
> INSERT INTO persona_followers(service_id, follower_id, valid_at) > SELECT service_id, follower_id, NOW() > FROM (SELECT DISTINCT service_id, follower_id FROM import) AS import > WHERE NOT EXISTS(SELECT * FROM persona_followers WHERE import.service_id > = persona_followers.service_id AND imp

Re: [GENERAL] Statistics query

2013-04-10 Thread Chris Curvey
On Wed, Apr 10, 2013 at 12:30 PM, Steve Crawford < scrawf...@pinpointresearch.com> wrote: > I'm seeking ideas on the best way to craft the following query. I've > stripped everything down to the bare essentials and simplified it below. > > Input data has a timestamp (actually an int received from

Re: [GENERAL] how to find which tables required indexes in postgresql

2013-04-10 Thread Chris Curvey
On Wed, Apr 10, 2013 at 9:19 AM, JotaComm wrote: > Hello, > > > 2013/4/10 Thomas Kellerer > >> Zahid Quadri, 10.04.2013 13:31: >> >> hi,, >>> >>> please suggest if there is any way which i can find which tables need >>> indexes in postgresql. >>> >> > You have some possibilities: > > - the log

Re: [GENERAL] Avoiding a deadlock

2013-03-11 Thread Chris Curvey
On Sat, Mar 9, 2013 at 4:20 PM, Paul Jungwirth wrote: > I have a long-running multi-row UPDATE that is deadlocking with a > single-row UPDATE: > > 2013-03-09 11:07:51 CST ERROR: deadlock detected > 2013-03-09 11:07:51 CST DETAIL: Process 18851 waits for ShareLock on > transaction 10307138; block

Re: [GENERAL] DONT_CARE Aggregate

2012-12-20 Thread Chris Curvey
On Thu, Dec 20, 2012 at 12:00 PM, Robert James wrote: > I see. What if I need to do this along with an Aggregate Query. Eg > something like: > > SELECT x,y,z, MAX(a), MAX(b), DONT_CARE_AS_LONG_AS_NOT_NULL(c), > DONT_CAR_AS_LONG_AS_P_IS_TRUE(d,p) > ... > GROUP BY x,y,z > > ah, I get what you're t

Re: [GENERAL] Need sql to pull data from terribly architected table

2012-10-23 Thread Chris Curvey
On Tue, Oct 23, 2012 at 2:52 PM, Gauthier, Dave wrote: > Here's the deal... > > ** ** > > Instead of architecting and loading a table like... > > create teble foo (col1 text, col2 text, col3 text, col4 text, col5 text); > > > insert into foo (col1,col2,col3,col4,col5) values > ('

Re: [GENERAL] unc paths, like and backslashes on 8.4

2012-09-27 Thread Chris Curvey
Many thanks to David and Albe for their kind assistance. I've looked at the docs and run some experiments, and this is what I found. I'm going to answer my own questions in a slightly different order, because it seems to make the explanation more logical. Note that the rules appear to be differe

[GENERAL] unc paths, like and backslashes on 8.4

2012-09-26 Thread Chris Curvey
I just don't get how we are supposed to use LIKE with backslashes in strings in 8.4. This is particularly vexing, because I have a field containing UNC paths that I need to search on (and eventually update). I have been looking at this page for guidance: http://www.postgresql.org/docs/8.4/static/

Re: [GENERAL] Best free tool for relationship extraction

2012-09-13 Thread Chris Curvey
I usually just forget her birthday, eye color, or name. Then she extracts herself from the relationship. QED.

Re: [GENERAL] BI tools and postgresql

2012-07-26 Thread Chris Curvey
On Wed, Jul 25, 2012 at 1:41 PM, Mark Phillips wrote: > I am seeking suggestions for business intelligence and data mining tools > compatible with postgresql. A new manager at a client's shop is leaning > toward the MS offerings. I would like to be able to speak to the issue. > I'm in the same

[GENERAL] meaning of "waiting" column in pg_stat_activity?

2012-07-23 Thread Chris Curvey
Just wondering...if a query is "waiting", what is it waiting for? Is this only for locks, or can it be for disk, or a memory buffer? (If there is a description of the meaning of things in pg_stat_activity and it's relatives, I'd love a pointer, 'cause I can't seem to find it.) -- e-Mail is the

Re: [GENERAL] I'd like to learn a bit more about how indexes work

2012-06-05 Thread Chris Curvey
On Tue, Jun 5, 2012 at 6:24 PM, Mike Christensen wrote: > Hi - > > I'm trying to increase my general knowledge about how indexes work in > databases. Though my questions are probably general and implemented > in a similar way across major relational DBs, I'm also curious as to > how they're impl

Re: [GENERAL] Confusion about composite indexes

2012-05-21 Thread Chris Curvey
On Mon, May 21, 2012 at 3:34 PM, Bill Mitchell wrote: > I am searching for some logic behind the selection of an index in > postgres -- it seems that if I have a composite index based on both columns > in a join table, it's only referenced if I query on the first term in the > composite index.

Re: [GENERAL] Test ODBC connection failed. Pleae help me to take a look. Thanks.

2012-04-30 Thread Chris Curvey
>you want psql not isql. On Mon, Apr 30, 2012 at 3:19 PM, yxj wrote: > Hi Scott, > > I amn't farmiliar with isql. Why I said isql is because that I did some > research. they said something related to isql. No matter it's isql or psql. > > 1)How can I test the odbc function? > 2) what's isql, in w

Re: [GENERAL] Hope for a new PostgreSQL era?

2011-12-12 Thread Chris Curvey
On Sat, Dec 10, 2011 at 9:28 PM, Craig Ringer wrote: > > One thing I think would be interesting for this would be to identify slow > queries (without doing detailed plan timing) and flag them for more > detailed timing if they're run again within time. I suspect this would > only be practical wi

Re: [GENERAL] Selecting All Columns Associated With Maximum Value of One Column

2011-10-05 Thread Chris Curvey
On Wed, Oct 5, 2011 at 7:34 PM, Rich Shepard wrote: > A table (chemistry) has columns named site_id, sample_date, param, quant, > and str_name (among other columns). I want to find the site_id, > sample_date, > and quant for a specific str_name and param. I cannot get the proper syntax > in the S

Re: [GENERAL] SQL Help - Finding Next Lowest Value of Current Row Value

2011-10-01 Thread Chris Curvey
On Sat, Oct 1, 2011 at 5:30 PM, Jeff Adams wrote: > Greetings, > > I have a large table (~19 million records). Records contains a field > identifying a vessel and a field containing an time (epoch). Using the > current rows vessel and time values, I need to be able to find the next > lowest time

Re: [GENERAL] Disallow access from psql, or allow access only from specific client app

2011-07-24 Thread Chris Curvey
On Sun, Jul 24, 2011 at 5:36 PM, Mario Puntin wrote: > > Hi everybody: > I searched the web trying to find an answer to this, but found none. I have > a postgresql server and a database, and I granted access to some users. > However I want them to access the data only through some specific client

[GENERAL] replacing a subquery with an outer join?

2011-07-21 Thread Chris Curvey
in an earlier thread, the following query was submitted: SELECT COUNT(*) FROM q > WHERE NOT EXISTS (SELECT 1 > FROM t AS t > WHERE t.mid = q.mid); and as part of his answer, David Johnson responded 3. Also, you are using a correlated sub

Re: [GENERAL] newbie question

2011-06-06 Thread Chris Curvey
On Mon, Jun 6, 2011 at 4:17 PM, Heine Ferreira wrote: > Hi > > Does Postgresql utilize hyperthreading and multiple cores on the relevant > processors on windows? > > Thanks > > H.F. > > It certainly looks like it on my machine! As far as my Linux box can tell, the "hyperthreaded" CPUs just appear

Re: [GENERAL] postgres segfaulting on pg_restore

2011-05-05 Thread Chris Curvey
> > > Hmm, that's pretty interesting. Possibly it's just another > manifestation of something scribbling past the end of its allocated > chunk, but my credence for that theory is way down if there's no add-on > code involved. Does the postmaster log show any messages like >WARNING: detect

Re: [GENERAL] postgres segfaulting on pg_restore

2011-05-04 Thread Chris Curvey
> > > It occurred to me that a simple explanation for a core dump there would > be if something had scribbled past the end of the preceding palloc > chunk. That would tend to clobber the "context" link of the palloc > chunk after it, which would send GetMemoryChunkSpace off into > never-never land

Re: [GENERAL] correlated query as a column and where clause

2011-04-15 Thread Chris Curvey
On Fri, Apr 15, 2011 at 11:22 AM, salah jubeh wrote: > Hello All, > > I am wondering, why I can not add the following ' A > 10' in the where > clause i.e. 'where nspname !~* 'pg_' and A > 10' > > Select nspname, (SELECT count(*) as count FROM pg_tables where schemaname = > nspname) as A >

Re: [GENERAL] postgres segfaulting on pg_restore

2011-04-07 Thread Chris Curvey
> > >> and, FWIW, here's another trace, which is NEARLY the same as the first one I posted, with the difference being a slightly different line number at #3. I will be quiet now and leave the brain trust to ponder. Let me know if there is anything else I can get for you guys. #0 0x006ce

Re: [GENERAL] postgres segfaulting on pg_restore

2011-04-07 Thread Chris Curvey
On Thu, Apr 7, 2011 at 10:45 AM, Tom Lane wrote: > Chris Curvey writes: > > And voila! Here is the backtrace: > > > #0 0x006ce317 in GetMemoryChunkSpace (pointer=0x347cc70) at > > mcxt.c:264 > > #1 0x006d3d56 in writetup_index (state=0x26fc530, t

Re: [GENERAL] postgres segfaulting on pg_restore

2011-04-07 Thread Chris Curvey
> > > Are you able to distribute your dataset - if not to the general public, > then to someone interested in identifying the fault? > probably not. but let me ask...maybe I can come up with a creative solution. > Does the same dataset crash Pg when restored on another machine? That is a good

Re: [GENERAL] postgres segfaulting on pg_restore

2011-04-07 Thread Chris Curvey
> > > Nor I. https://launchpad.net/~pitti/+archive/postgresql/+packages doesn't > seem to list any. > > Martin: Are your packages stripped, or do they include minimal debug info > in the main packages? Do you put your debuginfo debs anywhere accessible? > > I decided to just try building it myself

Re: [GENERAL] postgres segfaulting on pg_restore

2011-04-06 Thread Chris Curvey
On Mon, Apr 4, 2011 at 11:59 PM, Craig Ringer wrote: > On 05/04/11 11:18, Chris Curvey wrote: > > > This is on Ubuntu 10.10 server, 64-bit on Intel. I'm running Postgres > > 9.0.3, 64-bit from the ppa repository. > > > > What can I do to help the developer

[GENERAL] postgres segfaulting on pg_restore

2011-04-04 Thread Chris Curvey
Thank goodness I'm still in development! I'm trying to use pg_restore with a dump created with pg_dump. But it keeps failing with segmentation or general protection faults. My restore command is: $ sudo -u postgres pg_restore -d mydatabase -j8 mydatabase.dmp I've now tried five times, and gott