Josh Tolley wrote:
> If I understand the problem correctly, you might do something like
> this (if you're using 8.2 and have INSERT...RETURNING):
>
> INSERT INTO filename (filename_name) VALUES ('some_filename_here')
> RETURNING filename_id;
>
> This will return a value, for instance, 10. Then you'd do this:
>
> INSERT INTO path (path_filename_id, path) VALUES (10, 'your_path_here');
But what if the filename is already in the filenames table? It will give
an error due to duplicate values, so I'll have to do a SELECT after
that? I was kind of hoping there was a somewhat more elegant solution to
this.