News for hackers. Stuff that matters.
Re:Nine ways to shoot yourself in the foot with PostgreSQL by baq on Tuesday April 25, 2023 @03:37AM (#35697594)
I’d add ’not reading the table of contents of the manual’ to the list.

I’ve probably worked with hundreds of people now who use a database daily either in code or just to explore data and can count on two hands (optimistically…) the number of folks who actually read the fine manual in any other way than googling something specific. Pro tip: read it so you know what to google for!

Re:Nine ways to shoot yourself in the foot with PostgreSQL by nelsonic on Tuesday April 25, 2023 @03:40AM (#35697618)
Re:Nine ways to shoot yourself in the foot with PostgreSQL by xupybd on Tuesday April 25, 2023 @03:45AM (#35697649)
It took me too long to understand this. I always felt pressure to get things done so skipped reading the manual. Turns out I would have gotten more done had I just read the manual.
Re:Nine ways to shoot yourself in the foot with PostgreSQL by jaggederest on Tuesday April 25, 2023 @04:09AM (#35697788)
There's the hoary old cliche about "if I was given three hours to cut down a tree with an axe, I would spend the first hour sharpening the axe" but in many cases it's really true. You can look like a superhero just by pointing out some small feature that makes life easier.

One time I pointed out that, rather than reordering the tables to make loading work with foreign key constraints, we could pause trigger execution, load all the data, and then resume the triggers. pg_dump can even do it for you if you pick the options right (might be default), in addition to natively ordering the data correctly, but if you're messing around with large SQL files anyway, it's helpful..

Re:Nine ways to shoot yourself in the foot with PostgreSQL by j45 on Tuesday April 25, 2023 @09:42AM (#35700343)
Clever architecture and approach that borders on a series or layers of simple decisions can often put perform clever coding and maintain a greater degree of flexibility.
Re:Nine ways to shoot yourself in the foot with PostgreSQL by j45 on Tuesday April 25, 2023 @02:43PM (#35704846)
iOS Typo

*put perform = outperform

Re:Nine ways to shoot yourself in the foot with PostgreSQL by couchand on Tuesday April 25, 2023 @10:27AM (#35700960)
Here to point out that Lincoln said "six hours to cut down a tree... four hours sharpening", and I think that ratio is better.

He wasn't the first to observe the general principle, it's at least as old as the Bible[0].

[0]: https://biblehub.com/ecclesiastes/10-10.htm

Re:Nine ways to shoot yourself in the foot with PostgreSQL by hannofcart on Tuesday April 25, 2023 @05:10AM (#35698135)
Googling? That's so passe.

I just enter my vague question into this AI chat thingy and I try the first thing that it tells me on my production server.

Has worked fine for me so far. What could possibly go wrong?

Re:Nine ways to shoot yourself in the foot with PostgreSQL by duckmysick on Tuesday April 25, 2023 @07:16AM (#35698865)
You can ask this AI chat thingy if it's a good idea to experiment on your production server. Maybe it will suggest something else.
Re:Nine ways to shoot yourself in the foot with PostgreSQL by throw99998888 on Tuesday April 25, 2023 @11:27AM (#35701820)
"I'll copy paste this snippet from a 2013 StackOverflow thread instead."

"Let me just install this 2MB js dependency real quick. I don't know anything about its author nor if its maintained at all, but it will prevent me from writing 10 lines of vainilla js."

ChatGPT is a vast improvement from this.

Re:Nine ways to shoot yourself in the foot with PostgreSQL by bhawks on Tuesday April 25, 2023 @02:26PM (#35704614)
Wow that's old school.

Here we have an agent integrated into langchain that executes the command directly on the server. If there are any errors it uses ai to debug and fix them too.

!/s see https://python.langchain.com/en/latest/modules/agents/toolki...

Re:Nine ways to shoot yourself in the foot with PostgreSQL by dror on Wednesday April 26, 2023 @12:25AM (#35709624)
Agent, shmagent.

CREATE EXTENSION pggpt;

and you're done. The AI watches your db and adjusts the params on the fly as needed. We're joking, but I give it less than 12 months before there'll be something like this.

Re:Nine ways to shoot yourself in the foot with PostgreSQL by Already__Taken on Tuesday April 25, 2023 @05:42AM (#35698315)
I do find SQL not easy in this regard. alter table add constraint is a totally different command than alter table. gotchas like that.
Re:Nine ways to shoot yourself in the foot with PostgreSQL by j45 on Tuesday April 25, 2023 @02:44PM (#35704864)
It’s not that bad to learn sql by example.

Project based learning is best for sql and excel formulas. Start at the start and it builds up quickly.

Don’t worry it’s way less work than trying to make a nosql database into a sql database.

Re:Nine ways to shoot yourself in the foot with PostgreSQL by nerdponx on Tuesday April 25, 2023 @09:45AM (#35700384)
FWIW I think this is good advice for any tool. You don't have to (and shouldn't) read the manual front to back, but you absolutely should look at the table of contents and at least start reading the introductory material.