Notices tagged with sql, page 2

  1. I wonder if it's preferred to chain table joins or use subqueries... it seems like both ultimately accomplish the same thing, just in different ways. Which performs better? Something I'll have to stop being lazy about rebooting to check. (technically I could check now but I don't really want to while still on the LiveCD) #

    Thursday, 10-May-12 08:06:19 UTC from web
  2. So many joins @.@ #

    Thursday, 10-May-12 07:59:38 UTC from web
  3. A question arises: if a column references its own table as a foreign key with ON DELETE RESTRICT and just so happens to refer to its own row, is that row simply completely impossible to delete or will it be deleted normally? !coderpony #

    Thursday, 10-May-12 00:42:11 UTC from web
  4. Today's lesson: arrays are evil. http://dpaste.com/745811/ @bitshift !coderpony #

    Thursday, 10-May-12 00:31:17 UTC from web
  5. Hm, I think my problem is not enough tables. Let's refactor this whole thing and make like a bajilion tables. #

    Wednesday, 09-May-12 23:16:47 UTC from web
  6. @bitshift I dunno, I designed half of it while half asleep anyway. Here it is anyway for your perusal http://dpaste.com/745314/ (to anyone just joining us, I'm learning all of this as I go and currently lack the means to test whether I've gotten any of this right, so if the syntax and such is completely wrong it's because I have no idea what I'm doing) !coderpony #

    Wednesday, 09-May-12 05:34:44 UTC from web in context
  7. @bitshift So how'd I do? :) http://dpaste.com/745233/ !coderpony #

    Wednesday, 09-May-12 00:47:20 UTC from web in context
  8. @toksyuryel @bitshift I realized I forgot some conditionals in one of the stubbed functions, here's a fixed version of that http://dpaste.com/745201/ !coderpony #

    Tuesday, 08-May-12 23:10:58 UTC from web in context
  9. @bitshift I have stubbed out several functions and created the triggers to demonstrate how I plan to constrain the arrays http://dpaste.com/745194/ !coderpony #

    Tuesday, 08-May-12 23:05:16 UTC from web in context
  10. @bitshift Let's see how horribly I botched this one up http://dpaste.com/745169/ !coderpony #

    Tuesday, 08-May-12 22:09:18 UTC from web in context
  11. @bitshift http://dpaste.com/745125/ here's what it looks like now !coderpony #

    Tuesday, 08-May-12 20:50:47 UTC from web in context
  12. @bitshift As long as I'm using dpaste I might as well just post the entire file. Let me know how much I screwed everything up! http://dpaste.com/745106/ !coderpony #

    Tuesday, 08-May-12 20:34:16 UTC from web in context
  13. Did I do this right? ` replyto bigint CHECK (replyto IS NOT postid AND replyto IS CASE WHEN conversation IS NOT postid THEN NOT NULL),` !coderpony #

    Tuesday, 08-May-12 20:19:16 UTC from web in context
  14. I'm guessing this is invalid... ` mentions text[] CHECK (mentions ALL REFERENCES users),` I'm actually not sure how to do this correctly. How do I write a constraint to compare all the values in an array to rows in a different table? (PostgreSQL) #

    Tuesday, 08-May-12 18:50:06 UTC from web
  15. Using PostgreSQL, can a foreign key reference the table it appears in? Or is there some other way to do this? !coderpony #

    Tuesday, 08-May-12 01:48:17 UTC from web in context