Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #36289

Re: psycopg2 cursor.execute CREATE TABLE issue

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!newsfeed.x-privat.org!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.054
X-Spam-Evidence '*H*': 0.89; '*S*': 0.00; 'subject:skip:c 10': 0.07; 'executes': 0.09; 'commit': 0.15; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'sees': 0.16; 'subject:issue': 0.16; 'mon,': 0.16; 'wrote:': 0.17; 'jan': 0.18; 'otherwise,': 0.20; 'work.': 0.23; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'received:209.85.212': 0.28; 'figure': 0.30; 'up.': 0.31; 'code': 0.31; 'gets': 0.32; 'to:addr :python-list': 0.33; 'received:google.com': 0.34; 'table': 0.35; 'received:209.85': 0.35; 'something': 0.35; 'created': 0.36; 'but': 0.36; 'url:org': 0.36; 'enough': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'url:docs': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'your': 0.60; 'most': 0.61; 'today': 0.67; '2013': 0.84; 'url:psycopg': 0.84; 'working,': 0.84; 'preventing': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=ML1f4oaiHeRR0JoZTT0G+SJgm1SxqS4eYWXmbk1vStk=; b=jzEf/XdUW89WPUHgUiAQ0VwNV/xdRvOaBaVyCcjbnIverN4n3d3C6ZZjEKDloOpKhy 4h0abImGAAPxWgR+EdjgPyK3J98np+stoZgpinMtn2vxVsYjwM3goQS7Rq+oIlMgkMmw aMKniP6jRO6SJzmuQybcmiGtn9GZ1q3TJEoBZA0awujoZLXViaidm7sgAypH8IWAYgvy MvouD4eLp8v++H/u4SRPsZb6bNCHDCdkzkub9N+a34MvD8ZnEJY0pAYZd88CwGVQjLTz FlmZiJ2G4kWJqXYFh9rSYIqq8tEBsTMhELUQR34tib0qnGmemKQhuZW6lJNIbF+dvmyJ +71g==
MIME-Version 1.0
In-Reply-To <185b6d9e-99ce-4f2a-81ea-d9a63b81b4cf@googlegroups.com>
References <185b6d9e-99ce-4f2a-81ea-d9a63b81b4cf@googlegroups.com>
Date Mon, 7 Jan 2013 08:45:51 +1100
Subject Re: psycopg2 cursor.execute CREATE TABLE issue
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.187.1357508761.2939.python-list@python.org> (permalink)
Lines 10
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1357508761 news.xs4all.nl 6962 [2001:888:2000:d::a6]:40573
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:36289

Show key headers only | View raw


On Mon, Jan 7, 2013 at 8:38 AM,  <andydtaylor@gmail.com> wrote:
> But something is preventing this from working, and I don't know enough to figure it out, despite having spent most of today reading up. The code executes with no error, yet no table is created or populated.

Standard databasing requirement: You need to commit your work.

http://initd.org/psycopg/docs/connection.html#connection.commit

Otherwise, the transaction gets rolled back, and nobody sees your changes.

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

psycopg2 cursor.execute CREATE TABLE issue andydtaylor@gmail.com - 2013-01-06 13:38 -0800
  Re: psycopg2 cursor.execute CREATE TABLE issue Mitya Sirenef <msirenef@lightbird.net> - 2013-01-06 16:44 -0500
    Re: psycopg2 cursor.execute CREATE TABLE issue Walter Hurry <walterhurry@lavabit.com> - 2013-01-06 22:37 +0000
  Re: psycopg2 cursor.execute CREATE TABLE issue Chris Angelico <rosuav@gmail.com> - 2013-01-07 08:45 +1100
    Re: psycopg2 cursor.execute CREATE TABLE issue andydtaylor@gmail.com - 2013-01-06 13:53 -0800
      Re: psycopg2 cursor.execute CREATE TABLE issue Mitya Sirenef <msirenef@lightbird.net> - 2013-01-06 17:14 -0500
      Re: psycopg2 cursor.execute CREATE TABLE issue Chris Angelico <rosuav@gmail.com> - 2013-01-07 09:19 +1100
    Re: psycopg2 cursor.execute CREATE TABLE issue andydtaylor@gmail.com - 2013-01-06 13:53 -0800

csiph-web