Le mardi 30 janvier 2007 12:19, woger151 a écrit : > (3) Use LASTVAL for this one : look at http://people.planetpostgresql.org/xzilla/index.php?/archives/169-Is-lastval-evil.html > > My questions: > * Are any of these methods flawed? > * Is there any reason to prefer (1) to (2)? > * I'm not sure whether LASTVAL is guaranteed to work outside of a > transaction. Its description in the 8.1 manual starts with "Return the > value most recently returned by nextval in the current session. ..." but > I'm not sure of the formal sense in which "session" is being used. (I'm > connecting to the DB from mod_php in apache, so I guess "session" could > mean "during the existence of a given db connection," but I'm not sure.)