[CLUE-Tech] PostgreSQL: psql dry heaves (no usable error message)

Grant Johnson grant at amadensor.com
Sat Jan 19 10:25:15 MST 2002


Jed S. Baer wrote:

>Well, psql (or Postgres) won't run this DDL, and all it tells me is it has
>a parse error at or near "" (i.e. null string). Any thoughts?
>
>TIA
>
>create table job (
>  id			serial
>    constraint contact_pk primary key,
>  company_id		int4
>    constraint job_company_fk
>      references company (id),
>  location_id		int4
>    constraint job_location_fk
>      references location (id),
>  person_id		int4
>    constraint job_person_fk not null
>      references person (id),
>  perm_flag		bool not null,
>  tax_type		text not null
>    constraint job_tax_type_chk
>      check (
>        tax_type in ('W2','1099','C2C')
>      ),
>  rate			money,
>  rate_type		text
>    constraint job_rate_type_chk
>      check (
>        rate_type in ('hourly','monthly','annual')
>      ),
>  accepted_flag		bool not null,
>  start_date		date,
>  end_date		date,
>  notes			text,
>  constraint job_tax_type_chk
>    check (
>      ( perm_flag and (tax_type = 'W2')
>      ) OR
>      ( (NOT perm_flag)
>        AND (tax_type in ('1099','C2C')
>      )
>)
>
That message is almost always a missing comma.  I believe that a comma 
is required before the constraint, but I will try it here...





More information about the clue-tech mailing list