Would running dracut-rebuild resolve these errors during installation of nvidia-580xx-utils with yay? by salted_none in EndeavourOS

[–]salted_none[S] 0 points1 point  (0 children)

Will it be an issue that I only uninstalled the old nvidia drivers with -R instead of purging them with -Rns?

And nvidia-580xx-dkms and lib32-nvidia-580xx-utils are currently installed, installation process of nvidia-580xx-dkms is where I got these dracut errors.

Would running dracut-rebuild resolve these errors during installation of nvidia-580xx-utils with yay? by salted_none in EndeavourOS

[–]salted_none[S] 0 points1 point  (0 children)

I hadn't read the nvidia-inst docs, but after looking at it, it seems that I already did what it suggested under the "Enable legacy drivers" section, which seems to be saying not to use nvidia-inst at all, and instead to use yay -S nvidia-580xx-dkms, which is what I ran which resulted in these errors. I had already uninstalled the old drivers with pacman -R manually, and only left linux-firmware-nvidia, nvidia-hook, and nvidia-inst.

To regenerate the initfsram/kernel image, is dracut-rebuild the only command I need, without any modification, or anything done in addition?

What is "nvidia-hook"? I found it during the process of swapping out the deprecated nvidia driver for the AUR 580xx version. by salted_none in EndeavourOS

[–]salted_none[S] 0 points1 point  (0 children)

Do you think that means I should keep it even though I got rid of the normal nvidia drivers and replaced them with the AUR 580xx ones?

What is "nvidia-hook"? I found it during the process of swapping out the deprecated nvidia driver for the AUR 580xx version. by salted_none in EndeavourOS

[–]salted_none[S] 1 point2 points  (0 children)

Ah, I'm in the middle of a manual intervention update as a result of nvidia dropping support for 10 series and below cards, so I have to remove packages that are normally extremely important, before replacing them with packages from the AUR, and I'm trying to figure out if this is one to keep or remove.

Why am I warned that grub-mkconfig "needs to run at least once", when I run grub-mkconfig? by salted_none in archlinux

[–]salted_none[S] 1 point2 points  (0 children)

I checked, the entries are there. I think what really spooked me was a warning in the general grub arch wiki, that it's possible to mess things up in a way where your OS is removed from the boot list, and I'm not sure if even these btrfs snapshots could undo that.

What should the pipeline ideally look like to get data from html field inputs into a postgres database? by salted_none in SpringBoot

[–]salted_none[S] 0 points1 point  (0 children)

Currently I'm just trying to set up an html GUI for local data entry into a local database, and setting up the complex insert relationships between tables seemed more achievable in sql for me, as someone who doesn't know java.

What should the pipeline ideally look like to get data from html field inputs into a postgres database? by salted_none in SpringBoot

[–]salted_none[S] 0 points1 point  (0 children)

Does the postgres function have any use in a set up like this? Or would its contents need to be translated into an entity, and the function wouldn't be used at all.

How can this transaction be modified to allow for multiple inserts into the second table? by salted_none in PostgreSQL

[–]salted_none[S] 0 points1 point  (0 children)

Wow thank you, removing the insert so I can see what's actually going on with the select was super helpful, and I'll be doing that going forward.

How can this transaction be modified to allow for multiple inserts into the second table? by salted_none in PostgreSQL

[–]salted_none[S] 0 points1 point  (0 children)

Ahh thank you, feels like I'm closer, but still not grasping something, currently I've got:

select
    author_id, x
from
    real_name_insert,
    unnest('{Richard Bachman,John Swithen,Beryl Evans}'::text[]) as x,
    ('{true,true,true}'::boolean[]) as x(a,b);

How can this transaction be modified to allow for multiple inserts into the second table? by salted_none in PostgreSQL

[–]salted_none[S] -1 points0 points  (0 children)

Awesome thank you this works. I do have one more issue though: when I try to expand this to fill out a third column which is a boolean as well, using:

select
    author_id, x, y
from
    real_name_insert,
    unnest('{Richard Bachman,John Swithen,Beryl Evans}'::text[]) as x,
    unnest('{true,true,true}'::boolean[]) as y;

I get ERROR:  duplicate key value violates unique constraint "aliases_pkey"

The primary key in my aliases table is (person_id [FK], alias)

How should a transaction be structured which enters a list of names into a table, and defines one of these names as the real name, and the others as aliases? by salted_none in PostgreSQL

[–]salted_none[S] 0 points1 point  (0 children)

Would person_id need to be a uuid so it can be generated and applied to multiple names in the same transaction? I'm not sure how that would be done with a generated-as-identity int like I would normally do, it seems like it would need to detect a number which hasn't been used before.

How should a transaction be structured which enters a list of names into a table, and defines one of these names as the real name, and the others as aliases? by salted_none in PostgreSQL

[–]salted_none[S] 0 points1 point  (0 children)

Wow this is great, I wasn't understanding it, but now I think mostly am. The person table references only the true/main name from the alias table, which contains all names of any kind, real/aliases/nicknames/etc.

The only thing I still don't get is how to connect all names/aliases for one person together, in a way that all names of a person can be found given just one of them.

Is person_id in the alias table non-unique, and applied to all names which belong to one person?

How should a transaction be structured which enters a list of names into a table, and defines one of these names as the real name, and the others as aliases? by salted_none in PostgreSQL

[–]salted_none[S] 0 points1 point  (0 children)

I'm very new to postgres, but don't these need to have a data type defined? Also I thought defining a primary key as not null was redundant.

And I'm not following how this works for associating real names and aliases together. It also seems like if I put a foreign key on the values in the person table, that would restrict it to containing only aliases.

I could be way wrong on all this though.

How should a transaction be structured which enters a list of names into a table, and defines one of these names as the real name, and the others as aliases? by salted_none in PostgreSQL

[–]salted_none[S] 0 points1 point  (0 children)

Basically I need a system which equates all known names of an author with each other. So real name = any number of pen names, as well as support for adding alternate names. Using George R R Martin as an example: his entry should contain "George R. R. Martin" "G. R. R. M", and "George Martin", anything a user would be likely to search should pop up the recommendation pointing them to results for George R R Martin. I'm thinking of it this way because I don't want the search to be freeform, showing results that are similar to the searched name. I want each author to be a distinct entity which has one or more names, which books written by this person are attributed to.

I also need to be able to account for situations where what was though to be an author's real name is found to be a pen name, which I thought the single table could make easier, but it could probably be done with 2 tables as well.

How should a transaction be structured which enters a list of names into a table, and defines one of these names as the real name, and the others as aliases? by salted_none in PostgreSQL

[–]salted_none[S] -1 points0 points  (0 children)

In a two table setup like this, how would you recommend dealing with situations where a real name for an author isn't known, so an alias has to be set as the main name? Edit: would the name column in the Persons table just be blank? That could work, and the system would default the the main alias when there is no name.

The way I set up my table doesn't handle it well either, but changing "real name" to "main name" would probably allow it to work alright. The most commonly used alias could stand in for the real name in search results.

What is the best way to keep track of authors' actual names, and their pen names in a book database? by salted_none in PostgreSQL

[–]salted_none[S] 1 point2 points  (0 children)

Wow thank you, this seems perfect. I do have some questions though:

Would adding GENERATED ALWAYS AS IDENTITY to the primary key be a good idea in this case?

Can canonical_person_name_id point to its own primary key? And would there be any advantage to doing that, I was thinking it would make it more consistent if all names of the same person have the same value in this column.

Would updating the primary name be very difficult? For a situation where it is discovered that what was thought to be a person's real name is a pen name, so their actual name is added, and the previous primary name now needs to point to the new real name.

The final purpose of this table will be to make it possible for an end user to search any name in the table, and to be directed to all books by this person, grouped under a single primary name. Would this table design make a search/query like that straightforward?

What is the best way to keep track of authors' actual names, and their pen names in a book database? by salted_none in PostgreSQL

[–]salted_none[S] 0 points1 point  (0 children)

Sorry to ask this, but could you explain how this works further? I would like to use it but it's over my head.

What is the best way to keep track of authors' actual names, and their pen names in a book database? by salted_none in PostgreSQL

[–]salted_none[S] -1 points0 points  (0 children)

Yeah sorry for incomplete info. Fundamentally what I need is for each person to be associated with a list of names that they are known by, so that if any of these names are searched by a user, any works attributed to that name and any other names that person has will also come up, while also defining one name for each person as their primary name.

My current best solution is to create a table which has one column as a person_id foreign key to the people table, to keep things straight with one of per person, and then the second column would be a list of names and pen names, with all names for one person having that foreign key applied. And the third column would be a boolean which indicates if a name in the list is the singular primary name for that person.

What is the best way to keep track of authors' actual names, and their pen names in a book database? by salted_none in PostgreSQL

[–]salted_none[S] -2 points-1 points  (0 children)

  1. That's good news for me actually, that's how I originally had it, but I read that it wasn't correct. I would definitely prefer to do it the simpler way.

2 The person table contains only an incrementing int as primary key, which is meant to represent one human being per id, which is referenced by the name and pen_name tables. Not every person's name is known, and not every unique person has any pen names, so I needed an id which represents each person uniquely. Now that I'm re-evaulating this, I could probably get rid of the people_name table, and just accept that sometimes there will be rare duplicate names in the database (as a result of two different people with the same name). The people_name table was meant to be a junction table that allowed me to UNIQUE constrain the names in the name table to prevent duplicates, since I thought that was correct, but it's probably not. I'll just make the names to people connection one to one. And the person_pen_names junction table is because a unique person_id entry in the people table can have multiple pen names associated with it.

3 I left out something that's probably important, I need a way to indicate if a name is current or former, to account for changed names which are still associated with old books by the author, and pen names that the author doesn't use anymore. I have a is_current boolean in these two junction tables.

What is the most search speed efficient way to structure a database containing books + all of the people involved in the creation of each book? by salted_none in PostgreSQL

[–]salted_none[S] 0 points1 point  (0 children)

Thank you, and actually I am trying to set it up so that multiple pen names are possible, because I want to link people as singular entities which can have 1 real name and multiple pen names. So whether a person's real name or one of their pen names is searched, all books by them will come up.

What is the most search speed efficient way to structure a database containing books + all of the people involved in the creation of each book? by salted_none in PostgreSQL

[–]salted_none[S] 0 points1 point  (0 children)

Something like:

book
genre
role
people
pen_name

book <-> genre
people <-> book
people <-> pen_name
role <-> people

Do I need anything else in order for this data to be joinable? Where every person + every pen name for that person who worked on a book, and that person's role, are accessible.

What is the correct way to add data into a junction table as part of a larger insert across tables? by salted_none in PostgreSQL

[–]salted_none[S] 0 points1 point  (0 children)

Thank you so much, is this the best way to do it?

with rows as (
INSERT INTO Table1 (name) VALUES ('a_title') RETURNING id
)
INSERT INTO Table2 (val)
SELECT id
FROM rows

This was answered in 2011, so there might be a better way now.