Saturday, 2 November 2019

Modifying any part of a row in a table? (Postgres)

This question is for relational databases, so for example a row in a table:id, name, age, weight, hair_colorSo now if I wanted to modify any of those columns, first thing comes to mind is "I have to write 5 separate queries to modify each column". Doesn't seem right... although I'm currently under the impression you can't do anonymous/dynamic table name queries(in Postgres)... so it seems like you have to... unless I'm missing something?I'm not using GraphQL at this time, so just wondering what standard procedures are.I also don't know if it's "a vulnerability" if you wrote an API query that can be dynamic(although still has the different queries written say as switch cases) but you have a thing that's like "Modify what" and you pass the table name you want to change. Which isn't going to build a dynamic query due to that non-anonymous thing but could turn 5 endpoints into one... I guess that would not be very "RESTy".

Submitted November 02, 2019 at 03:05PM by crespo_modesto

No comments:

Post a Comment