psycopg help

From: Scott Frankel <leknarf(at)pacbell(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: psycopg help
Date: 2004-10-14 04:14:41
Message-ID: 92511043-1D97-11D9-AEEC-000A95A7B782@pacbell.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


First, apologies in advance for this somewhat OT post ...

I'm looking for a source of information on using the psycopg
interface to postgresql. A mailing list would be ideal. I've
poked at their wiki, but not found what I'm looking for.

Also, new to both postrgresql & psycopg, my questions appear
too basic for the doc/examples they provide with their installation.
i.e.:

- What's the appropriate syntax for specifying a primary key?

- What is the data type "text?" And how does it differ from
CHAR(len), &c.?

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:
curs.execute("""CREATE TABLE key_test (
key_col CHAR(9) PRIMARY KEY,
nother_col CHAR(256))""")

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

Thanks!
Scott

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Nageshwar Rao 2004-10-14 04:59:11 clustering
Previous Message Tom Lane 2004-10-14 03:59:16 Re: creating audit tables