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 t...@sss.pgh.pa.us wrote: Chris Curvey ch...@chriscurvey.com 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 items fit

[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

[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

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 AM, Chris Curvey wrote: I've done

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 ccur...@zuckergoldberg.com writes: I have a database

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.amount)

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 arupraks...@rocketmail.com 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

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 robert.difa...@gmail.comwrote: 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

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 ch...@chriscurvey.comwrote: On Mon, Apr 14, 2014 at 12:27 PM, Robert DiFalco robert.difa...@gmail.com 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

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,

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 kg...@argility.com 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

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
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 databases : Need to dump a table as inserts from db1

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 kg...@argility.com 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

[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

Re: [GENERAL] authentication failure

2014-01-03 Thread Chris Curvey
On Fri, Jan 3, 2014 at 4:16 AM, Jayadevan M maymala.jayade...@gmail.comwrote: 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

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 tim.k...@gmail.com 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

[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 database

Re: [GENERAL] Trouble installing psycopg2

2013-09-26 Thread Chris Curvey
On Thu, Sep 26, 2013 at 1:01 PM, Laura Tateosian aug...@gmail.com 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

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 jeff.ja...@gmail.com wrote: On Tue, Sep 10, 2013 at 10:37 AM, Chris Curvey ccur...@zuckergoldberg.com wrote: Great thought. Looking through the logs, it appears that all my failures are on a CREATE INDEX. Usually on my biggest table

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/mm/') AS

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 ch...@chriscurvey.comwrote: On Thu, Sep 12, 2013 at 4:34 PM, Roberto Scattini roberto.scatt...@gmail.com wrote: we are using postgresql 9.1 from ubuntu

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 ccur...@zuckergoldberg.commailto: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: [archiver (db)] could not

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 ccur

[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

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, 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

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

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 jota.c...@gmail.com wrote: Hello, 2013/4/10 Thomas Kellerer spam_ea...@gmx.net 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:

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 the

Re: [GENERAL] Avoiding a deadlock

2013-03-11 Thread Chris Curvey
On Sat, Mar 9, 2013 at 4:20 PM, Paul Jungwirth p...@illuminatedcomputing.comwrote: 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

Re: [GENERAL] DONT_CARE Aggregate

2012-12-20 Thread Chris Curvey
On Thu, Dec 20, 2012 at 12:00 PM, Robert James srobertja...@gmail.comwrote: 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

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 dave.gauth...@intel.comwrote: 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

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

[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:

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.

[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 m...@kitchenpc.com 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

Re: [GENERAL] Confusion about composite indexes

2012-05-21 Thread Chris Curvey
On Mon, May 21, 2012 at 3:34 PM, Bill Mitchell b...@publicrelay.com 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

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 leaf_...@163.com 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

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 ring...@ringerc.id.au 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 x time. I suspect this would

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 rshep...@appl-ecosys.comwrote: 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

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 jeff.ad...@noaa.gov 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

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 mario...@gmail.com 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

[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

Re: [GENERAL] newbie question

2011-06-06 Thread Chris Curvey
On Mon, Jun 6, 2011 at 4:17 PM, Heine Ferreira heine.ferre...@gmail.comwrote: 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

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: detected

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 s_ju...@yahoo.com 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 =

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 -- it

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
On Thu, Apr 7, 2011 at 10:45 AM, Tom Lane t...@sss.pgh.pa.us wrote: Chris Curvey ch...@chriscurvey.com writes: And voila! Here is the backtrace: #0 0x006ce317 in GetMemoryChunkSpace (pointer=0x347cc70) at mcxt.c:264 #1 0x006d3d56 in writetup_index (state=0x26fc530

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 0x006ce317

Re: [GENERAL] postgres segfaulting on pg_restore

2011-04-06 Thread Chris Curvey
On Mon, Apr 4, 2011 at 11:59 PM, Craig Ringer cr...@postnewspapers.com.auwrote: 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 developers find the root cause

[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