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


Groups > comp.lang.python > #39524

Re: psycopg2 craziness

References <2427e351-dd19-4e13-af76-d1c41aa5ad3d@googlegroups.com>
Date 2013-02-22 17:22 +1100
Subject Re: psycopg2 craziness
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.2240.1361514159.2939.python-list@python.org> (permalink)

Show all headers | View raw


On Fri, Feb 22, 2013 at 10:27 AM,  <andydtaylor@gmail.com> wrote:
>>>> cursor_to.execute("CREATE TABLE foo (id serial PRIMARY KEY);")

Like many things, it's silent when everything works. As MRAB
suggested, you probably need to commit before the changes become
visible; unlike certain other database engines, PostgreSQL actually
provides transactional integrity for DDL queries (CREATE/DROP TABLE
etc) as well as DML queries (INSERT/UPDATE etc). This is incredibly
handy, but can be surprising if you're accustomed to them being
immediately visible to other sessions.

But next time you ask for help, don't say that you're "having issues"
- say *what* issues you're having! It makes helping you so much easier
if we know up front what you need help with, rather than being forced
to guess :)

(By the way, does anyone else see irony in there being "craziness" in
a module that's pretty much called "psycho"?)

ChrisA

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


Thread

psycopg2 craziness andydtaylor@gmail.com - 2013-02-21 15:27 -0800
  Re: psycopg2 craziness MRAB <python@mrabarnett.plus.com> - 2013-02-22 00:36 +0000
    Re: psycopg2 craziness andydtaylor@gmail.com - 2013-02-21 16:44 -0800
    Re: psycopg2 craziness andydtaylor@gmail.com - 2013-02-21 16:44 -0800
  Re: psycopg2 craziness Chris Angelico <rosuav@gmail.com> - 2013-02-22 17:22 +1100

csiph-web