Re: [GENERAL] Employee modeling question

2014-09-05 Thread Nelson Green
> > > I could store the department and business attributes with the >> > employee, but without proper constraints the referenced department >> > could conceivably not correspond to the referenced business. Or I >> > could ensure that all businesses have at least one department, >> > defaulting to t

Re: [GENERAL] Merge requirements between offline clients and central database

2014-09-05 Thread Kevin Grittner
Sameer Thakur wrote: > As part of database evaluation one key requirements is as follows: > > 1. There are multiple thick clients (say 20 ~ 100) with their local > databases accepting updates > 2. They sync data with a central database which can also receive updates > itself. > 3. They may not

Re: [GENERAL] Employee modeling question

2014-09-05 Thread John McKown
On Fri, Sep 5, 2014 at 7:52 AM, Nelson Green wrote: > > Thanks Robin. Ironically enough, our little local library has three books by > Joe Celko, so looks like I may have a weekend of reading ahead of me. I'm impressed that your library has him. But, unless you are _very_ good with SQL, you're go

Re: [GENERAL] how to pass tablename to a function

2014-09-05 Thread Igor Neyman
-Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of alecinvan Sent: Thursday, September 04, 2014 6:28 PM To: pgsql-general@postgresql.org Subject: [GENERAL] how to pass tablename to a function Hi, All I like to pass the t

Re: [GENERAL] Exists subquery in an update ignores the effects of the update itself

2014-09-05 Thread Kevin Grittner
Jeff Janes wrote: > I want to update some data in unique column. Some of the updates > would conflict if applied to eligible rows, and for now I want to > skip those updates, applying only one of a set of conflicting > ones. > > create table foo (x text unique); > insert into foo values ('aac'),

Re: [GENERAL] Re: [ADMIN] Cannot retrieve images inserted through VB and odbc, after a table reorganization.

2014-09-05 Thread Alanoly Andrews
Hi Adrian, 1. We are storing our large objects in a table column whose datatype is "lo" (which, I understand, ultimately is in fact "bytea"). 2. The error messge returned to the VB is, yes, very generic. And the backend postgres server does not have any messages relevant to this issue. 3. We set

Re: [GENERAL] Employee modeling question

2014-09-05 Thread Nelson Green
On Fri, Sep 5, 2014 at 9:46 AM, John McKown wrote: > On Fri, Sep 5, 2014 at 7:52 AM, Nelson Green > wrote: > > > > Thanks Robin. Ironically enough, our little local library has three > books by > > Joe Celko, so looks like I may have a weekend of reading ahead of me. > > I'm impressed that your

[GENERAL] Re: [ADMIN] Cannot retrieve images inserted through VB and odbc, after a table reorganization.

2014-09-05 Thread David G Johnston
On Fri, Sep 5, 2014 at 11:34 AM, Alanoly Andrews [via PostgreSQL] < ml-node+s1045698n5817949...@n5.nabble.com> wrote: > Hi Adrian, > > 1. We are storing our large objects in a table column whose datatype is > "lo" (which, I understand, ultimately is in fact "bytea"). > ​ The "lo" data type is effe

Re: [GENERAL] Employee modeling question

2014-09-05 Thread Rich Shepard
On Fri, 5 Sep 2014, John McKown wrote: They are excellent. They are _not_ for beginners. The "For Smarties" portion is not just a play against the "For Dummies" series. Joe does some high powered SQL. I read Joe Celko's columns in Database Advisor and a couple of other magazines in the '80s,

[GENERAL] count on cascading deletes

2014-09-05 Thread Eildert Groeneveld
Dear All prior to issuing a cascading delete in an interactive program I would like to retrieve from Postgresql what is involved in the particular delete, so that this can be printed to the console and the user can be asked: This is what your delete would do in the database: deleting panel

[GENERAL] Querying a time range across multiple partitions

2014-09-05 Thread Cal Heldenbrand
Hi everyone, I'm trying to run a select query from a span of child partitions, separated out in daily tables, in Postgres 9.1.5. The parent looks like this: # \d logins Table "public.logins" Column|Type | Modifiers -+---

Re: [GENERAL] count on cascading deletes

2014-09-05 Thread Kevin Grittner
Eildert Groeneveld wrote: > prior to issuing a cascading delete in an interactive program > I would like to retrieve from Postgresql what is involved in the > particular delete, so that this can be printed to the console > and the user can be asked: > > This is what your delete would do in the

Re: [GENERAL] count on cascading deletes

2014-09-05 Thread Adrian Klaver
On 09/05/2014 09:49 AM, Eildert Groeneveld wrote: Dear All prior to issuing a cascading delete in an interactive program I would like to retrieve from Postgresql what is involved in the particular delete, so that this can be printed to the console and the user can be asked: This is what you

Re: [GENERAL] count on cascading deletes

2014-09-05 Thread David G Johnston
Eildert Groeneveld wrote > Dear All > > prior to issuing a cascading delete in an interactive program > I would like to retrieve from Postgresql what is involved in the > particular delete, so that this can be printed to the console > and the user can be asked: > >This is what your delete wou

Re: [GENERAL] Querying a time range across multiple partitions

2014-09-05 Thread Alban Hertroys
On 05 Sep 2014, at 19:31, Cal Heldenbrand wrote: > I'm attempting to run a query that looks something like this: > > explain analyze select time,event from logins > where username='bob' and hash='1234' and time > current_date - interval '1 > week'; > > Result (cost=0.00..765.11 rows=1582

Re: [GENERAL] Querying a time range across multiple partitions

2014-09-05 Thread John R Pierce
On 9/5/2014 10:31 AM, Cal Heldenbrand wrote: Number of child tables: 1581 that's an insane number of children.We try and limit it to 50 or so child tables, for instance, 6 months retention by week, of data will millions of rows/day. -- john r pierce

Re: [GENERAL] Querying a time range across multiple partitions

2014-09-05 Thread Cal Heldenbrand
What about: > explain analyze select time,event from logins > where username='bob' and hash='1234' and time > (current_date - interval > '1 week’)::timestamp without time zone; > > Also, you don’t appear to be having an index that starts from “time”, so > none of the indexes will be particularly

Re: [GENERAL] Querying a time range across multiple partitions

2014-09-05 Thread Cal Heldenbrand
This particular use case is for user behavior data mining. The hardware is beefy, and has tablespaces split out onto SSD/spindle for new & old data. All of my queries are pretty much a nightly cron process, and I don't really care too much about the speed. Scanning the full 4 years of data takes

Re: [GENERAL] Re: [ADMIN] Cannot retrieve images inserted through VB and odbc, after a table reorganization.

2014-09-05 Thread Adrian Klaver
On 09/05/2014 08:33 AM, Alanoly Andrews wrote: Hi Adrian, 1. We are storing our large objects in a table column whose datatype is "lo" (which, I understand, ultimately is in fact "bytea"). As way of testing where the issue is, you might explore saving some images in a test table directly to

Re: [GENERAL] Querying a time range across multiple partitions

2014-09-05 Thread David G Johnston
Cal Heldenbrand wrote > explain analyze select time,event from logins > where username='bob' and hash='1234' and time in ( > select array_agg(series) > from generate_series(current_date - interval '3 days', current_date, > interval '1 day') > as u(series) > ); > ERROR: operator does

[GENERAL] inserting a text file via json

2014-09-05 Thread john.tiger
we want to store markdown text files into our json fields - can this be done ? I guess we could have a separate json field and bytea field for the markdown file but this might be difficult when it comes to our REST response - anyone do something like this ? -- Sent via pgsql-general mailing