<!-- 
RSS generated by JIRA (8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b) at Sat Feb 10 16:44:38 JST 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>PFS-JIRA</title>
    <link>https://pfspipe.ipmu.jp/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>8.3.4</version>
        <build-number>803005</build-number>
        <build-date>13-09-2019</build-date>
    </build-info>


<item>
            <title>[OBSPROC-38] add a unique constraint of (proposal_id, ob_code) in the target table</title>
                <link>https://pfspipe.ipmu.jp/jira/browse/OBSPROC-38</link>
                <project id="11003" key="OBSPROC">PFS observation processing/procedure</project>
                    <description>&lt;p&gt;(proposal_id, ob_code) pair must be unique to track the progress. It will need to be implemented in the target table of targetdb.&lt;/p&gt;</description>
                <environment></environment>
        <key id="23360">OBSPROC-38</key>
            <summary>add a unique constraint of (proposal_id, ob_code) in the target table</summary>
                <type id="3" iconUrl="https://pfspipe.ipmu.jp/jira/secure/viewavatar?size=xsmall&amp;avatarId=10518&amp;avatarType=issuetype">Task</type>
                                            <priority id="10000" iconUrl="https://pfspipe.ipmu.jp/jira/images/icons/priorities/medium.svg">Normal</priority>
                        <status id="10002" iconUrl="https://pfspipe.ipmu.jp/jira/images/icons/statuses/generic.png" description="The issue is resolved, reviewed, and merged">Done</status>
                    <statusCategory id="3" key="done" colorName="green"/>
                                    <resolution id="10000">Done</resolution>
                                        <assignee username="monodera">monodera</assignee>
                                    <reporter username="monodera">monodera</reporter>
                        <labels>
                            <label>targetDB</label>
                    </labels>
                <created>Thu, 20 Apr 2023 02:44:27 +0000</created>
                <updated>Thu, 20 Apr 2023 10:53:54 +0000</updated>
                            <resolved>Thu, 20 Apr 2023 10:53:54 +0000</resolved>
                                                                    <component>ets_target_database</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>1</watches>
                                                                <comments>
                            <comment id="32588" author="monodera" created="Thu, 20 Apr 2023 04:37:23 +0000"  >&lt;p&gt;I modified code and tried to update the schema with alembic. The update script returned errors by detecting duplicates for the unique constraint. It seems some objects have been inserted twice.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;targetdb_comm2022may=# SELECT proposal_id, ob_code, ra, dec, count&lt;img class=&quot;emoticon&quot; src=&quot;https://pfspipe.ipmu.jp/jira/images/icons/emoticons/star_yellow.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; FROM target GROUP BY proposal_id, ob_code, ra, dec HAVING count&lt;img class=&quot;emoticon&quot; src=&quot;https://pfspipe.ipmu.jp/jira/images/icons/emoticons/star_yellow.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; &amp;gt; 1;&lt;br/&gt;
 proposal_id | ob_code | ra | dec | count&lt;br/&gt;
 ------------&lt;del&gt;+&lt;ins&gt;&lt;/del&gt;-----------------------------------------&lt;del&gt;&lt;/ins&gt;+&lt;/del&gt;-------------------&lt;br/&gt;
 S23A-EN16 | r_0_ishigaki_ga_2023feb | 204.98178239 | 28.2770517 | 2&lt;br/&gt;
 S23A-EN16 | r_10000_ishigaki_ga_2023feb | 205.49925232 | 28.39503098 | 2&lt;br/&gt;
 S23A-EN16 | r_10001_ishigaki_ga_2023feb | 205.49926758 | 28.36640549 | 2&lt;br/&gt;
 S23A-EN16 | r_10002_ishigaki_ga_2023feb | 205.49926758 | 28.35559845 | 2&lt;br/&gt;
 S23A-EN16 | r_10003_ishigaki_ga_2023feb | 205.49928284 | 28.3361454 | 2&lt;br/&gt;
 S23A-EN16 | r_10004_ishigaki_ga_2023feb | 205.4992981 | 28.33244896 | 2&lt;br/&gt;
 S23A-EN16 | r_10005_ishigaki_ga_2023feb | 205.4992981 | 28.33455276 | 2&lt;br/&gt;
 S23A-EN16 | r_10006_ishigaki_ga_2023feb | 205.4992981 | 28.25308037 | 2&lt;br/&gt;
 S23A-EN16 | r_10007_ishigaki_ga_2023feb | 205.49931335 | 28.39699745 | 2&lt;br/&gt;
 S23A-EN16 | r_10008_ishigaki_ga_2023feb | 205.49932861 | 28.40284538 | 2&lt;br/&gt;
 S23A-EN16 | r_10009_ishigaki_ga_2023feb | 205.49932861 | 28.39302063 | 2&lt;br/&gt;
 S23A-EN16 | r_1000_ishigaki_ga_2023feb | 205.69470905 | 28.42560075 | 2&lt;br/&gt;
 S23A-EN16 | r_10010_ishigaki_ga_2023feb | 205.49934387 | 28.38490105 | 2&lt;br/&gt;
 S23A-EN16 | r_10011_ishigaki_ga_2023feb | 205.49935913 | 28.30970573 | 2&lt;br/&gt;
 S23A-EN16 | r_10012_ishigaki_ga_2023feb | 205.49935913 | 28.3936615 | 2&lt;br/&gt;
 S23A-EN16 | r_10013_ishigaki_ga_2023feb | 205.49937439 | 28.31223869 | 2&lt;br/&gt;
 S23A-EN16 | r_10014_ishigaki_ga_2023feb | 205.49937439 | 28.31671143 | 2&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Perhaps, it will be safe to delete one of duplicated rows, but wait for a bit.&lt;/p&gt;</comment>
                            <comment id="32593" author="monodera" created="Thu, 20 Apr 2023 10:52:47 +0000"  >&lt;p&gt;Using the following queries, I deleted one of two entries of duplicates. Then the alembic update succeeded.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;targetdb_comm2022may=# SELECT ct, count() AS ct_ct FROM (SELECT proposal_id, ob_code, ra, dec, count() AS ct FROM target GROUP BY proposal_id, ob_code, ra, dec HAVING count&lt;img class=&quot;emoticon&quot; src=&quot;https://pfspipe.ipmu.jp/jira/images/icons/emoticons/star_yellow.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt; &amp;gt; 1) sub GROUP BY 1 ORDER BY 1;&lt;br/&gt;
ct | ct_ct&lt;br/&gt;
---&lt;del&gt;+&lt;/del&gt;------&lt;br/&gt;
2 | 97561&lt;br/&gt;
(1 row)&lt;/p&gt;

&lt;p&gt;targetdb_comm2022may=# DELETE FROM target a USING target b WHERE a.target_id &amp;gt; b.target_id AND a.ob_code = b.ob_code;&lt;br/&gt;
DELETE 97561&lt;/p&gt;&lt;/blockquote&gt;</comment>
                            <comment id="32594" author="monodera" created="Thu, 20 Apr 2023 10:53:54 +0000"  >&lt;p&gt;The database column was updated.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10500" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10006" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>OBSPROC-1</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|zzswrz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10100" key="com.atlassian.jira.plugin.system.customfieldtypes:userpicker">
                        <customfieldname>Reviewers</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>monodera</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>