Re: [GENERAL] PL/pgSQL Copy data from one table to another

2014-02-08 Thread David Johnston
George Ant wrote > Hey Guys, > > Thank you for your replies! Your suggestions worked fine!! :) Also my code > looks a lot cleaner now! > > Kind Regards, > George Ant. Have you considered just creating a view, or even retrieval functions, the generate these "object forms" on the fly instead of

Re: [GENERAL] PL/pgSQL Copy data from one table to another

2014-02-08 Thread George Ant
Hey Guys, Thank you for your replies! Your suggestions worked fine!! :) Also my code looks a lot cleaner now! Kind Regards, George Ant. -- View this message in context: http://postgresql.1045698.n5.nabble.com/PL-pgSQL-Copy-data-from-one-table-to-another-tp5790663p5791086.html Sent from the

Re: [GENERAL] PL/pgSQL Copy data from one table to another

2014-02-05 Thread Elliot
On 2014-02-05 10:36, ChoonSoo Park wrote: On Wed, Feb 5, 2014 at 7:53 AM, George Ant mailto:g.antonopoulos...@gmail.com>> wrote: Hey Guys, I am trying to copy data from one table to another using plpgsql. The two tables have different structure cause the new one is object-table

Re: [GENERAL] PL/pgSQL Copy data from one table to another

2014-02-05 Thread ChoonSoo Park
On Wed, Feb 5, 2014 at 7:53 AM, George Ant wrote: > Hey Guys, > > I am trying to copy data from one table to another using plpgsql. The two > tables have different structure cause the new one is object-table. My > function is this : > > CREATE OR REPLACE FUNCTION copy_customers() RETURNS integer a

[GENERAL] PL/pgSQL Copy data from one table to another

2014-02-05 Thread George Ant
Hey Guys, I am trying to copy data from one table to another using plpgsql. The two tables have different structure cause the new one is object-table. My function is this : CREATE OR REPLACE FUNCTION copy_customers() RETURNS integer as $BODY$ DECLARE idcounter integer := 1; firstname t