attn.: psycopg users -- simple question - Mailing list pgsql-general

From Scott Frankel
Subject attn.: psycopg users -- simple question
Date
Msg-id 06358EE4-1E37-11D9-AEEC-000A95A7B782@circlesfx.com
Whole thread Raw
Responses Re: attn.: psycopg users -- simple question  (Scott Frankel <leknarf@pacbell.net>)
List pgsql-general
Sorry to burden this list (again) with a psycopg question.
I'm stuck at a table creation step and am not getting results
from their list.

Question:  what's the appropriate syntax for specifying a primary
key?

My very simple table creation test (based on their "first.py"
example is failing ...  Here's what I'm trying.  Non-pythonated
syntax works in pgsql:

no go in psycopg:
    curs.execute("""CREATE TABLE key_test (
    key_col CHAR(9) PRIMARY KEY,
    nother_col CHAR(256))""")

pure joy in pgsql:
    cs_test=# CREATE TABLE key_test (
    cs_test(# key_col CHAR(9) PRIMARY KEY,
    cs_test(# nother_col CHAR(256)
    cs_test(# );

Thanks again!
Scott


pgsql-general by date:

Previous
From: Barry S
Date:
Subject: Re: Change query priority
Next
From: peter Willis
Date:
Subject: How do I recover from>> pg_xlog/0000000000000000 (log file 0, segment 0) failed: No such file or directory