Search Postgresql Archives

Re: Populate Table From Two Other Tables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 5 Jun 2012, Greg Williamson wrote:

Try a single equals sign, e.g. WHERE c.site = s.siteid

Greg,

  I'm surprised: that worked! I thought the WHERE clause was looking for
equivalency, not an assignment.

  There's another problem now that will be more difficult to fix. Postgres
tells me, 'psql:populate-waterchem.sql:6: ERROR:  duplicate key value
violates unique constraint "waterchem_pkey"'. But, when I SELECT rows based
on the primary key only a single row is returned.

  I think the most parsimonious solution is to use an awk script to add the
stream and basin columns to the chemistry.txt file. That also eliminates
having to export the combined table to a text file.

Thanks,

Rich


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux