|
Posted by rich on 08/10/06 14:39
Erwin Moller wrote:
> rich wrote:
>
> > I am running this SQL statement in php 4.39 to Postgresql 7.3.4 and I
> > keep getting this error
> >
> > Warning: pg_query(): Query failed: ERROR: syntax error at or near
> > "WITHOUT" at character 29 in /var/www/html/liberty/includes/test2.php
> > on line 12
> >
> > I can't figure out why this is failing.
> >
> > $buildtableQ = "CREATE TABLE $tempname WITHOUT OIDS AS
> > SELECT rt.resid, max(rt.transdate)
> > FROM li_roomtransfer as rt
> > JOIN li_resident AS r ON rt.resid = r.resid
> > WHERE r.nursehomeid = '1'AND r.distribid = '1'
> > GROUP BY rt.resid";
> > $buildtableR = pg_query($buildtableQ); This is Line 12. any
> > suggestions?
>
>
> Hi,
>
> You misplaced the WITHOUT OIDS.
> Read more here:
> http://www.postgresql.org/docs/7.3/interactive/sql-createtable.html
>
> Regards,
> Erwin Moller
>
> PS: What do you have against OIDs? :P
I have done some reading and I can't remember where that states if you
don't need to use OID's don't. There is a finite number of them within
the database and you can hit that limit. I know its a huge number, but
why use them? I usually have my primary keys on each of the tables I
design. Isn't that redundant?
Navigation:
[Reply to this message]
|