Execute changes in Photoshop Elements
(1) By athegn (AlanFarthing) on 2021-04-22 08:53:53 [link]
I am a new user of SQLite (or have forgotten what I learnt a number of years ago); mea culpa rules at my age. I am trying to edit a data for Photoshop Elements. I am working on a copy of the *db file; will over write the proper *db file when all running correctly. The database is catalog.pse17db. I have found that the volume_table needs a number of changes. Firstly the D: is no longer holding my images; these are now held on my H: drive. So I need to change the serial of all the records that refer to the old D: The new D: is an SD Card with serial 19088743; the volume_table records it as 961743104 giving a filter of 173. I assume that 961743104 is the serial of the now defunct D: HDD. The new H: is a serial of 1114066568 giving a filter of 1774182. I have changed the volume table by amending the D:l to 19088743. When I close then reopen the db file my changes to the volume_table are shown but the media _table needs updating. But I need to change the volume_id in the media_table from 173 to the new H; filter 1774182. How do I update the media table? Do I need some SQL to execute?
(2) By athegn (AlanFarthing) on 2021-04-22 12:26:08 in reply to 1 [link]
I should have said that I am using DB Browser (SQLite)
(3) By Larry Brasfield (larrybr) on 2021-04-22 17:28:23 in reply to 1
> I am trying to edit a data for Photoshop Elements. > ... > How do I update the media table? Do I need some SQL to execute? As I recall, the Photoshop variants are pricey. If it is not (created by a team) clever enough to accommodate removable drive detail changes, Adobe should at least get a support call from such a deficiency, IMO. If they will still talk to you for your money, they may have a ready-made solution. If you are dedicated to doing this yourself, without the application's intermediation, then you need to study the database schema, write some queries to figure out what can be extracted that remains useful, form the basis of revised data, and test any transformations you devise. Then you will need to write some DML statements to effect the changes. All of that will involve reading and writing some SQL. If this is a common situation faced by Photoshop users, you might be able to find some help or tools for that specific problem in a Photoshop user's group or something similar. I have to say that the part of your post I elided meant virtually nothing to me other than indicating that much more detail would be needed before you could reasonably expect an answer here. SQLite's use in Photoshop does not mean that you should expect to find Photoshop SQLite database expertise here. Your problem is very specific to one application's use of the DB engine.
(4) By athegn (AlanFarthing) on 2021-04-22 17:50:24 in reply to 3 [link]
Thank you for your reply. I actually caused the problem. Photoshop provides a means to transfer data from one drive to another. But I was doing a major upgrade to my whole system and took the drive that held Photoshop data out of my system. I then used a backup of the data to get it into the new drive but forgot that the database references the old drive. So I cannot now use the method that Photoshop provides to correct the database. But I can see what is required. I just do not have the SQL skills to do so. I just need to find in the media_table volume_id value 173 and change to value 1774182. BTW not all Photoshop applications are that pricey. I use Photoshop Elements, which I bought several years ago and it more than meets my requirements; I just need to keep in mind that I have to follow its rules.
(5) By Larry Brasfield (larrybr) on 2021-04-22 18:07:15 in reply to 4 [link]
If this is as simple as you suggest, then: You should create a <u>[SELECT query](https://sqlite.org/lang_select.html)</u> to be sure you have a WHERE clause that filters out all rows except the one you want to change. You can verify the column name and content then. You will write an <u>[UPDATE statement](https://sqlite.org/lang_update.html)</u> to change just the columns in just that row. The WHERE clause will match what you verified to be adequate with the select. Repeat as necessary. Most DB tools have a way to view the schema. That will likely aid your search for the right places to munge that data.
(6) By Ryan Smith (cuz) on 2021-04-22 18:20:34 in reply to 4 [link]
I'm afraid it's really hard to follow your post - perhaps not by lack of your explanation skills, but by lack of knowledge on the subject of Photoshop file schema. Either way, if this is really all you need: > I just need to find in the media_table volume_id value 173 and change to value 1774182. Then a simple: ``` UPDATE media_table SET volume_id = 1774182 WHERE volume_id = 173 ; ``` Should do the trick just fine. Note: I am not confident that this won't break anything else in the file, it's hard to make out from your post, so please keep the backups handy while testing. Also - I'd urge you to consider reading the documentation carefully (Larry linked what is needed), especially if that query is not immediately obvious to you. Best of luck!
(7) By Keith Medcalf (kmedcalf) on 2021-04-22 18:32:12 in reply to 4 [link]
Is the value 173 or '173'. One is an integer and the other is a text string. Mutatis mutandis the value 1774182. Is that 1774182 (the integer) or '1774182' (the text string). They may **look the same** when printed on the monitor, but they are **not the same**.
(8) By athegn (AlanFarthing) on 2021-04-23 09:41:50 in reply to 7 [link]
Yes I do understand; I regularly used ISNUM in Excel to check this. In DB Browser for SQLite:- Data Structure > volume_Table > id = INTEGER; rest of fields are TEXT Data Structure > media_Table > volume_id = INTEGER
(9) By athegn (AlanFarthing) on 2021-04-25 07:33:58 in reply to 8 [link]
Thank you for all your help. Matters now resolved. This exercise will teach me to slow down and carefully plan major changes to my data workflow.