From: | Krystian Samp <samp(dot)krystian(at)gmail(dot)com> |
---|---|
To: | Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com> |
Cc: | Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net>, psycopg(at)postgresql(dot)org |
Subject: | Re: results via pgAdmin but not via psycopg2 |
Date: | 2013-12-31 17:26:49 |
Message-ID: | A64FE981-F01C-4912-8DC9-E0C0B6095D2C@gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | psycopg |
Thank you guys,
On 31 Dec 2013, at 15:31, Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com> wrote:
> On 12/31/2013 05:14 AM, Krystian Samp wrote:
>> Thanks,
>>
>> This sounds good,
>>
>> Would a commit() be considered slow or undesirable?
>
> For the purpose of the SELECT, more unnecessary than anything else. You would be invoking a transaction for the sole purpose of rolling over a time value. This as pointed out can be solved without committing a transaction. For a detailed look at your options see:
>
> http://www.postgresql.org/docs/9.3/interactive/functions-datetime.html#FUNCTIONS-DATETIME-CURRENT
>
> 9.9.4. Current Date/Time
>
>
> It documents the behavior of the various date(time) functions.
>
>>
>> K
>>
>> On 31 Dec 2013, at 13:09, Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net> wrote:
>>
>>> On Tue, Dec 31, 2013 at 12:52:51PM +0000, Krystian Samp wrote:
>>>
>>>> Thank you so much, this was the problem indeed, and “connection.commit()” solved it.
>>>>
>>>> Didn’t think about committing after a SELECT command.
>>>
>>> If you want to spare the commit you may want to look at statement_timestamp();
>>>
>>> Karsten
>>> --
>>> GPG key ID E4071346 @ gpg-keyserver.de
>>> E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346
>>>
>>>
>>> --
>>> Sent via psycopg mailing list (psycopg(at)postgresql(dot)org)
>>> To make changes to your subscription:
>>> http://www.postgresql.org/mailpref/psycopg
>>
>>
>>
>
>
> --
> Adrian Klaver
> adrian(dot)klaver(at)gmail(dot)com
From | Date | Subject | |
---|---|---|---|
Next Message | David Kerr | 2013-12-31 18:35:52 | Insert with a lot of columns |
Previous Message | Adrian Klaver | 2013-12-31 15:31:33 | Re: results via pgAdmin but not via psycopg2 |