pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Emre Hasegeli <emre.hasegeli@tart.com.tr>
To: Andreas <maps.on@gmx.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: Question on imports with foreign keys
Date: Fri, 09 Dec 2011 11:39:07 +0200
Message-ID: <op.v57ufhrjk2xoe5@tart-hasegeli-development> (raw)
In-Reply-To: <4EE08CFE.3090209@gmx.net>
References: <4EE05DD3.2080308@gmx.net>
	<op.v55w0nozk2xoe5@tart-hasegeli-development>
	<4EE08CFE.3090209@gmx.net>

On Thu, 08 Dec 2011 12:10:06 +0200, Andreas <maps.on@gmx.net> wrote:

> Lets's say there were already 1000 records in the customers table.
> Now I add 357 new customers to this table.
>  If I use one of your queries I'd get all 1357 entries of customers  
> since "project_x.projectinfos" would be newly created for this project  
> and therefor empty.
>  I need to know which customers.id was created for which line in the  
> temporary table that I read in with copy.
> When I have those ids I can fill "project_x.projectinfos" with just  
> those new 357 customer.ids and foreign keys refering the new  
> lookup-tables.

Sorry, I do not understand exactly. What is the difference between the new  
357 customers and the existent 1000 customers? If it is the date they  
inserted, then the should be filtered by the date. If it is another  
attribute like project they are related, then they should be filtered by  
the project column or the relation table.



view thread (5+ messages)  latest in thread

Message-ID: <op.v57ufhrjk2xoe5@tart-hasegeli-development>
Permalink:  ../op.v57ufhrjk2xoe5@tart-hasegeli-development/
Also on:    postgresql.org/message-id/op.v57ufhrjk2xoe5@tart-hasegeli-development

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: emre.hasegeli@tart.com.tr, maps.on@gmx.net
  Subject: Re: Question on imports with foreign keys
  In-Reply-To: <op.v57ufhrjk2xoe5@tart-hasegeli-development>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox