pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
confused newbie (to pg not db's)
3+ messages / 2 participants
[nested] [flat]

* confused newbie (to pg not db's)
@ 2004-02-12 14:15 mike <mike@redtux1.uklinux.net>
  2004-02-12 15:45 ` Re: confused newbie (to pg not db's) Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: mike @ 2004-02-12 14:15 UTC (permalink / raw)
  To: pgsql-interfaces

I have setup a database that I am the owner of, and I am trying to setup
constraints and it doesn't seem to be working

Example

- Table: public."Invoice_Header"

-- DROP TABLE public."Invoice_Header";

CREATE TABLE public."Invoice_Header"
(
  "Inv_ID" int4 NOT NULL DEFAULT nextval('public."Invoice
Header_ID_seq"'::text),
  "client_ID" int2 NOT NULL,
  payable_recievable varchar(5),
  "date_CREATED" date,
  "AMOUNT" money,
  amount_paid money,
  date_paid date
) WITH OIDS;

I am trying to make Inv_ID a primary key as follows

alter table Invoice_Header ADD CONSTRAINT PK_inv PRIMARY KEY (Inv_ID)

which runs without error, but nothing changes

this is from psql with PG 7.3.2

any help appreciated




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: confused newbie (to pg not db's)
  2004-02-12 14:15 confused newbie (to pg not db's) mike <mike@redtux1.uklinux.net>
@ 2004-02-12 15:45 ` Tom Lane <tgl@sss.pgh.pa.us>
  2004-02-12 19:40   ` Re: confused newbie (to pg not db's) mike <mike@redtux1.uklinux.net>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2004-02-12 15:45 UTC (permalink / raw)
  To: mike <mike@redtux1.uklinux.net>; +Cc: pgsql-interfaces

mike <mike@redtux1.uklinux.net> writes:
> CREATE TABLE public."Invoice_Header"
                      ^^^^^^^^^^^^^^^^

> I am trying to make Inv_ID a primary key as follows

> alter table Invoice_Header ADD CONSTRAINT PK_inv PRIMARY KEY (Inv_ID)
              ^^^^^^^^^^^^^^

> which runs without error, but nothing changes

I think you have tables named "Invoice_Header" and "invoice_header",
and the latter table is what's getting affected by your ALTER.  If you
are going to use mixed-case names then you have to be consistent about
double-quoting them all the time.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: confused newbie (to pg not db's)
  2004-02-12 14:15 confused newbie (to pg not db's) mike <mike@redtux1.uklinux.net>
  2004-02-12 15:45 ` Re: confused newbie (to pg not db's) Tom Lane <tgl@sss.pgh.pa.us>
@ 2004-02-12 19:40   ` mike <mike@redtux1.uklinux.net>
  0 siblings, 0 replies; 3+ messages in thread

From: mike @ 2004-02-12 19:40 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-interfaces

On Thu, 2004-02-12 at 15:45, Tom Lane wrote:
> mike <mike@redtux1.uklinux.net> writes:
> > CREATE TABLE public."Invoice_Header"
>                       ^^^^^^^^^^^^^^^^
> 
> > I am trying to make Inv_ID a primary key as follows
> 
> > alter table Invoice_Header ADD CONSTRAINT PK_inv PRIMARY KEY (Inv_ID)
>               ^^^^^^^^^^^^^^
> 
> > which runs without error, but nothing changes
> 
> I think you have tables named "Invoice_Header" and "invoice_header",
> and the latter table is what's getting affected by your ALTER.  If you
> are going to use mixed-case names then you have to be consistent about
> double-quoting them all the time.
> 
> 			regards, tom lane
> 


I worked out what was happening - I was missing the ;

Not helped by pgaccess and pgadmin not working right in different ways

> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
>       subscribe-nomail command to majordomo@postgresql.org so that your
>       message can get through to the mailing list cleanly
> 



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2004-02-12 19:40 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-02-12 14:15 confused newbie (to pg not db's) mike <mike@redtux1.uklinux.net>
2004-02-12 15:45 ` Tom Lane <tgl@sss.pgh.pa.us>
2004-02-12 19:40   ` mike <mike@redtux1.uklinux.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox