Time |
Nick |
Message |
04:48 |
|
sleary joined #evergreen |
07:07 |
|
collum joined #evergreen |
07:23 |
|
kworstell-isl joined #evergreen |
08:11 |
|
BDorsey joined #evergreen |
08:15 |
|
kworstell_isl joined #evergreen |
08:33 |
|
sandbergja joined #evergreen |
09:23 |
|
Dyrcona joined #evergreen |
09:24 |
jmurray-isl |
++ |
09:27 |
jmurray-isl |
@coffee |
09:27 |
* pinesol |
brews and pours a cup of Guatemala El Injerto Pacamara, and sends it sliding down the bar to jmurray-isl |
09:28 |
* jmurray-isl |
thanks pinesol. |
09:37 |
Dyrcona |
Hm... How to do limit with a UNION so that the limit only affects part of the union, not the whole thing...... |
09:38 |
Dyrcona |
Wrong channel... :) Should post that in #postgresql, but think I'll try a few things first. |
09:39 |
Dyrcona |
Well, inverting the queries leads to a syntax error.... |
09:40 |
Dyrcona |
Ah! In my specific case, I know 1 part of the union produces 3 rows, so I could possibly limit 6, but I bet that still doesn't give me what I want. |
09:41 |
Dyrcona |
Yeahp. I get 6 from the second query and none from the first. |
09:42 |
Dyrcona |
Ok to the documentation and then the #postgresql channel. |
09:45 |
jeff |
does this help? |
09:45 |
jeff |
(select * from generate_series(1,5) limit 3) union all select * from generate_series(10,16); |
09:45 |
jeff |
semi-related to: "Multiple UNION operators in the same SELECT statement are evaluated left to right, unless otherwise indicated by parentheses." |
09:45 |
jeff |
from docs |
09:46 |
jeff |
there are probably several different syntaxes that will work, I don't know if any have optimizer implications. |
09:46 |
jeff |
a CTE, or subselect a la SELECT * FROM (SELECT ... LIMIT X) AS foo UNION ALL SELECT... |
09:46 |
Dyrcona |
jeff: I don't think that will work, but I can try it. |
09:47 |
Dyrcona |
I can also just run two selects in a file, which is probably the simplest thing. |
09:47 |
jeff |
that last one seems overly verbose with no other benefit, but again, sometimes there are optimizer implications that you want to take advantage of :-) |
09:48 |
Dyrcona |
I was thinking of trying parenthesis. |
09:48 |
jeff |
(the last example of mine) |
09:48 |
jeff |
the full query I pasted first does what I expect, but I may have misunderstood your goal. :-) |
09:48 |
Dyrcona |
Yeah, the CTE might work. I'm curious now, so I might try the different options just to see what happens. |
09:50 |
Dyrcona |
Well, I'm grabbing template output from an action_trigger. I have a template that spits out a slightly different message based on the patron profile group. I have 3 of a specific profile and hundreds with other profiles. I want to get the 3 that have the special message and 3 that don't. |
09:50 |
Dyrcona |
I thought I'd use a UNION with a LIMIT, but LIMIt can only apply to the "whole" query. |
09:52 |
Dyrcona |
Parenthesis around the select with the limit works. |
09:52 |
Dyrcona |
jeff++ |
09:53 |
|
sleary joined #evergreen |
09:59 |
Dyrcona |
They're not in any particular order in the output. |
10:56 |
|
briank joined #evergreen |
11:51 |
|
kmlussier joined #evergreen |
12:05 |
|
jihpringle joined #evergreen |
12:06 |
|
abneiman joined #evergreen |
12:06 |
|
jeff joined #evergreen |
12:09 |
|
Christineb joined #evergreen |
12:12 |
|
phasefx joined #evergreen |
12:23 |
|
Dhruv_Fumtiwala joined #evergreen |
12:24 |
Dhruv_Fumtiwala |
Hi, |
12:24 |
Dhruv_Fumtiwala |
Wanted to ask if the aged_circulation table is the one where a;; the daily material transactions are logged. |
12:24 |
Dhruv_Fumtiwala |
Can somebody please help. |
12:25 |
kmlussier |
Dhruv_Fumtiwala: No, they are stored in action.circulation |
12:26 |
kmlussier |
The aged_circulation table is where those transactions go if you set up the process to remove patron information from them. |
12:34 |
|
collum joined #evergreen |
13:32 |
Dyrcona |
Nothing like doing a marc_export to find bad bib records: Warning from bibliographic record 313383: Argument "I65" isn't numeric in integer division (/) at /usr/share/perl5/MARC/Record.pm line 407. |
13:41 |
Dyrcona |
Hmm. Maybe I should not have run this test with our largest member library.... It's taking a while to produce the output. :) |
13:42 |
|
sleary joined #evergreen |
14:06 |
|
Dhruv_Fumtiwala joined #evergreen |
14:06 |
Dhruv_Fumtiwala |
Dhruv_Fumtiwala: Which means, if we remove the patron information and if they had any circulations, they would go under aged circulation? |
14:10 |
Dyrcona |
Dhruv_Fumtiwala: There is a process that you can set up to "age" circulations. This process copies some information to the action.aged_circulation table from the action.circulation table and removes the connection to the patron. There are settings to control how the circulations have to be before this happens. It's purpose is to maintain circulation statistics and patron privacy. |
14:11 |
Dyrcona |
Let me check the code to answer your specific question about removing a patron. What are you trying to do/figure out? |
14:14 |
Dhruv_Fumtiwala |
I am trying to Understand the entire database as I wanna perform certain analysis of off it. |
14:16 |
Dyrcona |
Well, that's a tall order. :) |
14:16 |
Dyrcona |
When a patron is deleted, their circulations are moved to the action.aged_circulation table. |
14:17 |
Dhruv_Fumtiwala |
Ohh, that answers the question. Thank You. |
14:17 |
Dhruv_Fumtiwala |
Moreover, do you have visual schema of the database which I can request please. |
14:17 |
Dhruv_Fumtiwala |
If not I can create one on my own but it would be a bit intensive. |
14:17 |
Dyrcona |
There was an old one somewhere on the wiki that has not been updated for some time. I'll see if that still exists. |
14:18 |
Dhruv_Fumtiwala |
Sure, thanks |
14:22 |
Dyrcona |
Well, I can't find it. Looks like it is gone. There are table listings available: https://docs.evergreen-ils.org/3.1_schema/ |
14:22 |
Dyrcona |
That's for an older release, and I don't see one for the latest release. |
14:24 |
Dyrcona |
This page provides a developer overview and might be useful depending on what you're trying to do: https://wiki.evergreen-ils.org/doku.php?id=eg_developer_overview |
14:25 |
Dhruv_Fumtiwala |
Checking them now |
14:26 |
Dhruv_Fumtiwala |
The first one might be a bit helpful. I would work off of that, Thank you again. |
14:27 |
Dhruv_Fumtiwala |
One last question, aged_circulation, shouldn't it be linked to other tables as it has bunch of FK |
14:33 |
Dyrcona |
action.aged_circulation doesn't actually have the FK relationships because of how it is used. It's used to store information about old circulations, so it copies over field values for the most part, not foreign table IDs. |
14:36 |
Dhruv_Fumtiwala |
Make sense |
14:36 |
Dhruv_Fumtiwala |
Thank you for all the help |
15:04 |
Dyrcona |
Yeah. I should have chosen a smaller library, but I wanted one that would demonstrate a difference with owning_lib versus circ_lib. I don't think most of our smaller libraries do. |
15:21 |
Dyrcona |
If it doesn't finish soon, I may have to start it over on Monday. |
16:07 |
|
JBoyer joined #evergreen |
16:29 |
|
brianmk joined #evergreen |
16:33 |
|
briank joined #evergreen |
16:49 |
|
jihpringle joined #evergreen |
18:06 |
|
jihpringle joined #evergreen |