From julien at danjou.info Thu Dec 6 19:42:38 2012 From: julien at danjou.info (Julien Danjou) Date: Thu, 06 Dec 2012 20:42:38 +0100 Subject: [postmodern-devel] MD5 auth scheme broken? Message-ID: <878v9b55n5.fsf@dex.adm.naquadah.org> Hi there, (I'm new to CL & postmodern, so forgive me in advance.) I tried to use postmodern, but I kept getting: password authentication failed for user "foobar" as error, and I do know that my credentials are ok. Specifying the password as nil in `connect' made me discover that MD5 was used to authenticate. Then, changing 'md5' to 'password' in pg_hba.conf allowed me to connect using postmodern! It seems that the MD5 auth scheme is broken somehow in postmodern, or that I miss something. I'm using PostgreSQL 9.2 FWIW. Hint? -- Julien Danjou -- Free Software hacker & freelance -- http://julien.danjou.info -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 835 bytes Desc: not available URL: From xach at xach.com Thu Dec 6 21:01:56 2012 From: xach at xach.com (Zach Beane) Date: Thu, 06 Dec 2012 16:01:56 -0500 Subject: [postmodern-devel] MD5 auth scheme broken? In-Reply-To: <878v9b55n5.fsf@dex.adm.naquadah.org> (Julien Danjou's message of "Thu, 06 Dec 2012 20:42:38 +0100") References: <878v9b55n5.fsf@dex.adm.naquadah.org> Message-ID: <87lidayjwb.fsf@zpobx.site.sys> Julien Danjou writes: > Hi there, > > (I'm new to CL & postmodern, so forgive me in advance.) > > I tried to use postmodern, but I kept getting: > password authentication failed for user "foobar" > > as error, and I do know that my credentials are ok. > > Specifying the password as nil in `connect' made me discover that MD5 > was used to authenticate. Then, changing 'md5' to 'password' in > pg_hba.conf allowed me to connect using postmodern! > > It seems that the MD5 auth scheme is broken somehow in postmodern, or > that I miss something. I'm using PostgreSQL 9.2 FWIW. > > Hint? See https://github.com/marijnh/Postmodern/issues/27 - the md5 library changed. The next update of Quicklisp will include the Postmodern update. In the meantime, you could do something like this to get the update early: cd ~/quicklisp/local-projects git clone git://github.com/marijnh/Postmodern.git That local checkout will override Quicklisp's version of Postmodern. Zach From julien at danjou.info Thu Dec 6 21:11:55 2012 From: julien at danjou.info (Julien Danjou) Date: Thu, 06 Dec 2012 22:11:55 +0100 Subject: [postmodern-devel] MD5 auth scheme broken? In-Reply-To: <87lidayjwb.fsf@zpobx.site.sys> (Zach Beane's message of "Thu, 06 Dec 2012 16:01:56 -0500") References: <878v9b55n5.fsf@dex.adm.naquadah.org> <87lidayjwb.fsf@zpobx.site.sys> Message-ID: <87zk1q51ic.fsf@dex.adm.naquadah.org> On Thu, Dec 06 2012, Zach Beane wrote: > See https://github.com/marijnh/Postmodern/issues/27 - the md5 library > changed. The next update of Quicklisp will include the Postmodern > update. > > In the meantime, you could do something like this to get the update > early: > > cd ~/quicklisp/local-projects > git clone git://github.com/marijnh/Postmodern.git > > That local checkout will override Quicklisp's version of Postmodern. Awesome, thanks for your answer! -- Julien Danjou /* Free Software hacker & freelance http://julien.danjou.info */ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 835 bytes Desc: not available URL: From julien at danjou.info Tue Dec 25 20:22:43 2012 From: julien at danjou.info (Julien Danjou) Date: Tue, 25 Dec 2012 21:22:43 +0100 Subject: [postmodern-devel] Calling a SQL func as a DAO field value Message-ID: <87zk11zxt8.fsf@dex.adm.naquadah.org> Hi, I'm trying to use NOW() as a value in an update statement using the DAO. I've tried of syntax combinations, but I can't get the right one. Hint? -- Julien Danjou /* Free Software hacker & freelance http://julien.danjou.info */ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 835 bytes Desc: not available URL: From marijnh at gmail.com Tue Dec 25 20:26:01 2012 From: marijnh at gmail.com (Marijn Haverbeke) Date: Tue, 25 Dec 2012 21:26:01 +0100 Subject: [postmodern-devel] Calling a SQL func as a DAO field value In-Reply-To: <87zk11zxt8.fsf@dex.adm.naquadah.org> References: <87zk11zxt8.fsf@dex.adm.naquadah.org> Message-ID: Doesn't (:now) work? On Tue, Dec 25, 2012 at 9:22 PM, Julien Danjou wrote: > Hi, > > I'm trying to use NOW() as a value in an update statement using the DAO. > I've tried of syntax combinations, but I can't get the right one. > > Hint? > > -- > Julien Danjou > /* Free Software hacker & freelance > http://julien.danjou.info */ > > _______________________________________________ > postmodern-devel mailing list > postmodern-devel at common-lisp.net > http://lists.common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel > From julien at danjou.info Tue Dec 25 20:36:19 2012 From: julien at danjou.info (Julien Danjou) Date: Tue, 25 Dec 2012 21:36:19 +0100 Subject: [postmodern-devel] Calling a SQL func as a DAO field value In-Reply-To: (Marijn Haverbeke's message of "Tue, 25 Dec 2012 21:26:01 +0100") References: <87zk11zxt8.fsf@dex.adm.naquadah.org> Message-ID: <87vcbpzx6k.fsf@dex.adm.naquadah.org> On Tue, Dec 25 2012, Marijn Haverbeke wrote: > Doesn't (:now) work? No, I get: Value (:NOW) can not be converted to an SQL literal. I've actually tried "NOW()", which is a string and seemed not valid to me so I just didn't try that possibility, and it seems to work? But I'm worring of what would happen if my field was not a timestamp but a text? -- Julien Danjou ;; Free Software hacker & freelance ;; http://julien.danjou.info -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 835 bytes Desc: not available URL: From marijnh at gmail.com Tue Dec 25 20:43:17 2012 From: marijnh at gmail.com (Marijn Haverbeke) Date: Tue, 25 Dec 2012 21:43:17 +0100 Subject: [postmodern-devel] Calling a SQL func as a DAO field value In-Reply-To: <87vcbpzx6k.fsf@dex.adm.naquadah.org> References: <87zk11zxt8.fsf@dex.adm.naquadah.org> <87vcbpzx6k.fsf@dex.adm.naquadah.org> Message-ID: If I do cl-user> (s-sql:sql (:now)) It produces "now()" for me. On Tue, Dec 25, 2012 at 9:36 PM, Julien Danjou wrote: > On Tue, Dec 25 2012, Marijn Haverbeke wrote: > >> Doesn't (:now) work? > > No, I get: > > Value (:NOW) can not be converted to an SQL literal. > > I've actually tried "NOW()", which is a string and seemed not valid to > me so I just didn't try that possibility, and it seems to work? But I'm > worring of what would happen if my field was not a timestamp but a text? > > -- > Julien Danjou > ;; Free Software hacker & freelance > ;; http://julien.danjou.info From julien at danjou.info Tue Dec 25 20:47:42 2012 From: julien at danjou.info (Julien Danjou) Date: Tue, 25 Dec 2012 21:47:42 +0100 Subject: [postmodern-devel] Calling a SQL func as a DAO field value In-Reply-To: (Marijn Haverbeke's message of "Tue, 25 Dec 2012 21:43:17 +0100") References: <87zk11zxt8.fsf@dex.adm.naquadah.org> <87vcbpzx6k.fsf@dex.adm.naquadah.org> Message-ID: <87mwx1zwnl.fsf@dex.adm.naquadah.org> On Tue, Dec 25 2012, Marijn Haverbeke wrote: > If I do > > cl-user> (s-sql:sql (:now)) > > It produces "now()" for me. Sure, for me too. So let me give you a bit more context. If you've a class like: (defclass user () ((mytimestamp :col-type timestamp :accessor mytimestamp)) (:metaclass dao-class)) And try to do: (setf (mytimestamp user) '(:now)) (update-dao user) This raises things like: Value (:NOW) can not be converted to an SQL literal. at run-time. Maybe `setf' is not the right way to modify this field here? -- Julien Danjou # Free Software hacker & freelance # http://julien.danjou.info -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 835 bytes Desc: not available URL: From marijnh at gmail.com Tue Dec 25 20:52:53 2012 From: marijnh at gmail.com (Marijn Haverbeke) Date: Tue, 25 Dec 2012 21:52:53 +0100 Subject: [postmodern-devel] Calling a SQL func as a DAO field value In-Reply-To: <87mwx1zwnl.fsf@dex.adm.naquadah.org> References: <87zk11zxt8.fsf@dex.adm.naquadah.org> <87vcbpzx6k.fsf@dex.adm.naquadah.org> <87mwx1zwnl.fsf@dex.adm.naquadah.org> Message-ID: Ah, no, you can't do that. The stuff you put into slots are values, not sql expressions. You could call get-universal-time and somehow convert that to the same time system that now() is supposed to return, but you can't put a call in a slot. Best, Marijn On Tue, Dec 25, 2012 at 9:47 PM, Julien Danjou wrote: > On Tue, Dec 25 2012, Marijn Haverbeke wrote: > >> If I do >> >> cl-user> (s-sql:sql (:now)) >> >> It produces "now()" for me. > > Sure, for me too. So let me give you a bit more context. > > If you've a class like: > > (defclass user () > ((mytimestamp :col-type timestamp :accessor mytimestamp)) > (:metaclass dao-class)) > > And try to do: > (setf (mytimestamp user) '(:now)) > (update-dao user) > > This raises things like: > Value (:NOW) can not be converted to an SQL literal. > > at run-time. > > Maybe `setf' is not the right way to modify this field here? > > -- > Julien Danjou > # Free Software hacker & freelance > # http://julien.danjou.info