Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsreader4.netcologne.de!news.netcologne.de!xlned.com!feeder7.xlned.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'parsing': 0.07; 'strings.': 0.07; 'guys.': 0.09; 'postgres': 0.09; 'python:': 0.09; 'wrong,': 0.09; 'add/subtract': 0.16; 'andy': 0.16; 'received:74.55.86': 0.16; 'received:74.55.86.74': 0.16; 'received:smtp.webfaction.com': 0.16; 'received:webfaction.com': 0.16; 'retrieving': 0.16; 'value;': 0.16; 'string': 0.17; 'wrote:': 0.17; 'instance': 0.17; 'jan': 0.18; 'int,': 0.22; 'parse': 0.22; 'script': 0.24; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'values': 0.26; 'converting': 0.27; 'class': 0.29; 'function.': 0.33; 'minutes,': 0.33; 'text,': 0.33; 'to:addr:python-list': 0.33; 'thanks': 0.34; 'doing': 0.35; 'but': 0.36; 'subject:" ': 0.36; 'why': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'store': 0.38; 'things': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'help': 0.40; 'your': 0.60; 'first': 0.61; 'email addr:gmail.com': 0.63; '2013': 0.84; 'journey': 0.93 Date: Wed, 09 Jan 2013 21:56:19 -0500 From: Mitya Sirenef User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121011 Thunderbird/16.0.1 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Psycopg2 SyntaxError: invalid syntax on "INSERT INTO" database References: <717b5860-f35d-4c2f-a227-638568a8aae0@googlegroups.com> In-Reply-To: <717b5860-f35d-4c2f-a227-638568a8aae0@googlegroups.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1357786585 news.xs4all.nl 6866 [2001:888:2000:d::a6]:36239 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:36551 On Wed 09 Jan 2013 09:20:10 PM EST, andydtaylor@gmail.com wrote: > Thanks for your help guys. > > I was actually doing a few things wrong, but I have got this script to work by declaring fields as varchar and all values as strings. But I would like to log journey time values in hours/minutes, so I will have to look into the following: > > 1. Retrieving this data from postgres as text, converting it and using it. I will need to add/subtract on this time value; or > 2. Recognising it as a time class in the first instance by using the string parsing function. > > Regards, > > Andy Why not store as an int, in minutes, and then parse into h:m when displaying? - m -- Lark's Tongue Guide to Python: http://lightbird.net/larks/