Search Postgresql Archives

Re: Inserting Data

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

 



Bob Pawley <rjpawley@xxxxxxx> writes:
> What I have is one table which stores device_id numbers that are referenced 
> on the second table "library.devices".
> I need to insert device_ids from the first table that satisfy the conditions 
> of the argument found on the library table. Hence the 'where' clause.

This isn't real clear to me, but perhaps you are looking for something
like

	IF EXISTS(select 1 from library.devices where ...) THEN
		INSERT INTO ... values(new.device_id);
	END IF;

			regards, tom lane


[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