From tsufiev at gmail.com Fri Jul 4 10:30:43 2008 From: tsufiev at gmail.com (Timur Sufiev) Date: Fri, 4 Jul 2008 14:30:43 +0400 Subject: [postmodern-devel] FULL OUTER JOIN clause in s-sql (:outer-join) Message-ID: <289a24fb0807040330q2537a054j988ee7a47a29a140@mail.gmail.com> I've noticed recently that :outer-join spec isn't supported by s-sql, although it is mentioned in reference for postmodern-1.12. So i've added it myself. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: s-sql.patch Type: text/x-diff Size: 2130 bytes Desc: not available URL: From marijnh at gmail.com Fri Jul 4 10:44:49 2008 From: marijnh at gmail.com (Marijn Haverbeke) Date: Fri, 4 Jul 2008 12:44:49 +0200 Subject: [postmodern-devel] FULL OUTER JOIN clause in s-sql (:outer-join) In-Reply-To: <289a24fb0807040330q2537a054j988ee7a47a29a140@mail.gmail.com> References: <289a24fb0807040330q2537a054j988ee7a47a29a140@mail.gmail.com> Message-ID: Thanks. Applied! Not sure why the docs were talking about outer joins while the code had cross joins. Cheers, Marijn 2008/7/4 Timur Sufiev : > I've noticed recently that :outer-join spec isn't supported by s-sql, > although it is mentioned in reference for postmodern-1.12. So i've added it > myself. > > _______________________________________________ > postmodern-devel mailing list > postmodern-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel > > From tsufiev at gmail.com Fri Jul 4 11:43:32 2008 From: tsufiev at gmail.com (Timur Sufiev) Date: Fri, 4 Jul 2008 15:43:32 +0400 Subject: [postmodern-devel] FULL OUTER JOIN clause in s-sql (:outer-join) In-Reply-To: References: <289a24fb0807040330q2537a054j988ee7a47a29a140@mail.gmail.com> Message-ID: <289a24fb0807040443k68f9d5b1y40e77b0ecd7cf355@mail.gmail.com> On the second thought, it seems to me that :cross-join is redundant, 'cause "FROM *T1* CROSS JOIN *T2* is equivalent to FROM *T1*, *T2*." ( http://www.postgresql.org/docs/8.3/static/queries-table-expressions.html) and should be removed. But this would break compatibility with older code, so it's not my right to decide... 2008/7/4 Marijn Haverbeke : > Thanks. Applied! Not sure why the docs were talking about outer joins > while the code had cross joins. > > Cheers, > Marijn > > 2008/7/4 Timur Sufiev : > > I've noticed recently that :outer-join spec isn't supported by s-sql, > > although it is mentioned in reference for postmodern-1.12. So i've added > it > > myself. > > > > _______________________________________________ > > postmodern-devel mailing list > > postmodern-devel at common-lisp.net > > http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel > > > > > _______________________________________________ > postmodern-devel mailing list > postmodern-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marijnh at gmail.com Thu Jul 10 11:28:24 2008 From: marijnh at gmail.com (Marijn Haverbeke) Date: Thu, 10 Jul 2008 13:28:24 +0200 Subject: [postmodern-devel] Table extra options in DAO definition In-Reply-To: References: Message-ID: Hey Rafa?, Sorry for taking godawfully long to get back on this. I've pushed a patch that adds a bunch of table-definition utilities (see postmodern/deftable.lisp, and the corresponding docs). I'd be interested to hear if they work for you. Best, Marijn On Fri, Jun 13, 2008 at 8:26 PM, Rafa? Strzali?ski wrote: > 2008/6/13 Marijn Haverbeke : >> Hi Rafal, >> >> Thanks for the patch. I don't have time to look at it right now but >> I'll get back to you in a week or so. Chances are, though, that I >> won't be including it as is. > > That's not a problem. I'm using PM on my pet-project, so I can wait for > a "blessed" solution. > >> Did you ever use Postmodern before >> version 1.10? The deftable form I had was going in this same >> direction, but it became a mess, so I decided to separate the 'class >> definition' part form the 'table definition' part. A feature similar >> to your patch that I have been thinking about including is to add >> something specifically for adding extra indices, sequences, and >> constraints to a table -- I'm already using something like it in all >> my major postmodern-using projects. Note that most extra aspects of >> tables can be added with extra statements *after* the 'create table' >> command has been given, and thus can be completely separate from the >> dao-table-definition functionality. > > I would be fine if these extra aspects can be easy enabled/disabled. Droping > constraints (FKs, checks, and so on) is a very common while database > migration. > BTW Have You ever thinking supporting a db migration, from one schema > version to > another one? Something similar to Rails. > > Basiclly, I'm not a big fan on keeping all SQL-stuff into an > application code. I like > 'create.sql'/'drop.sql' kind of scripts. I'm thinking about PM port of > http://www.cliki.net/clsql-pg-introspect. > Maybe You already have something like that and could share :-) > > -- > Best regards, > Rafal Strzalinski (nabla) > http://nablaone.net > _______________________________________________ > postmodern-devel mailing list > postmodern-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel > From nablaone at gmail.com Mon Jul 14 19:16:24 2008 From: nablaone at gmail.com (=?UTF-8?Q?Rafa=C5=82_Strzali=C5=84ski?=) Date: Mon, 14 Jul 2008 21:16:24 +0200 Subject: [postmodern-devel] Table extra options in DAO definition In-Reply-To: References: Message-ID: 2008/7/10 Marijn Haverbeke : > Hey Rafa?, > > Sorry for taking godawfully long to get back on this. I've pushed a > patch that adds a bunch of table-definition utilities (see > postmodern/deftable.lisp, and the corresponding docs). I'd be > interested to hear if they work for you. Thanks. It works fine. At least unique-index :-) -- Pozdrawiam, Rafal Strzalinski (nabla) http://nablaone.net From arjan at streamtech.nl Fri Jul 25 14:03:12 2008 From: arjan at streamtech.nl (Arjan Wekking) Date: Fri, 25 Jul 2008 16:03:12 +0200 (CEST) Subject: [postmodern-devel] darcs patch: Correct rational (double-float) formatting Message-ID: <20080725140312.91E2317F9EC@mail.streamtech.nl> Fri Jul 25 15:52:12 CEST 2008 Arjan Wekking * Correct rational (double-float) formatting On Clozure CL (PPC32), (format "~f" (coerce 1/123 'double-float)) returns "0.008130081300813009D0" which is not a number syntax PostgreSQL understands. In order to be sure that a format is used that is always supported, the formatting string was changed to generate the number in exponential notation which is accepted by PostgreSQL and which can be reliably generated by at least SBCL and Clozure CL (only CLs I've tested). The modified control string in this patch ("~,,,,,,'EE") will generate for the rational 1/123 "8.130081300813009E-3" which is accepted and interpreted properly by PostgreSQL. -------------- next part -------------- A non-text attachment was scrubbed... Name: correct-rational-_double_float_-formatting.dpatch Type: text/x-darcs-patch Size: 22111 bytes Desc: A darcs patch for your repository! URL: From marijnh at gmail.com Fri Jul 25 15:14:30 2008 From: marijnh at gmail.com (Marijn Haverbeke) Date: Fri, 25 Jul 2008 17:14:30 +0200 Subject: [postmodern-devel] darcs patch: Correct rational (double-float) formatting In-Reply-To: <20080725140312.91E2317F9EC@mail.streamtech.nl> References: <20080725140312.91E2317F9EC@mail.streamtech.nl> Message-ID: > The modified control string in this patch ("~,,,,,,'EE") Well. that has to be the freakiest format string I've seen all week. Thanks for the patch, it has been applied. Best, Marijn From arjan at streamtech.nl Mon Jul 28 07:47:55 2008 From: arjan at streamtech.nl (Arjan Wekking) Date: Mon, 28 Jul 2008 09:47:55 +0200 Subject: [postmodern-devel] darcs patch: Correct rational (double-float) formatting In-Reply-To: References: <20080725140312.91E2317F9EC@mail.streamtech.nl> Message-ID: On 25 jul 2008, at 17:14, Marijn Haverbeke wrote: >> The modified control string in this patch ("~,,,,,,'EE") > > Well. that has to be the freakiest format string I've seen all week. > Thanks for the patch, it has been applied. Thanks, sorry for the rather blunt way my patch got send with Darcs; I'm still trying to get a grip on how it sends patches through e-mail (like; trying add a custom subject and/or introduction). Another idea I had was to simply represent rationals as a division (something like "(1/123::float)" but I'm not sure whether this has any precision loss or other disadvantages. -Arjan -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3405 bytes Desc: not available URL: From marijnh at gmail.com Mon Jul 28 08:11:33 2008 From: marijnh at gmail.com (Marijn Haverbeke) Date: Mon, 28 Jul 2008 10:11:33 +0200 Subject: [postmodern-devel] darcs patch: Correct rational (double-float) formatting In-Reply-To: References: <20080725140312.91E2317F9EC@mail.streamtech.nl> Message-ID: > sorry for the rather blunt way my patch got send with Darcs; No problem, your detailed patch message made it quite clear what it was about. I usually do 'darcs send -o filename.patch' and then attach the resulting file to an e-mail. > Another idea I had was to > simply represent rationals as a division (something like "(1/123::float)" > but I'm not sure whether this has any precision loss or other disadvantages. I'm not sure Postgres allows expressions in every place where it allows constants -- but maybe it does. The current approach seems okay though, since Postgres numerics always use decimal digits, so as long as the numeric type on the Postgres side has less digits precision than the writer writes out, we aren't losing any information that wouldn't be lost anyway. Best, Marijn