Re: [GENERAL] Dynamic insert into ARRAY? plpgsql

2014-02-08 Thread George Ant
Thank you for your Response! Inserting a sub-select into the array seems to be the solution that I want, but it gives me this error--> subquery must return only one column Any help? Kind Regards, George Ant -- View this message in context: http://postgresql.1045698.n5.nabble.com/Dyna

[GENERAL] Dynamic insert into ARRAY? plpgsql

2014-02-08 Thread George Ant
an error. (IT tries to create many rows for each Order which returns duplicate PK OrderId) How can I find how many orderlines have each row, and then insert them in one row? Each row of the Orders_object_table must have a unique PK OrderId , and a column with all the Orderlines this Order has.

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

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

2014-02-05 Thread George Ant
umns? Notice that the destination-tables are object tables and can be different than the old tables, so I am not sure if what I ask is possible. Kind Regards, George Ant -- View this message in context: http://postgresql.1045698.n5.nabble.com/PL-pgSQL-Copy-data-from-one-table-to-another-tp57906

Re: [GENERAL] Composite type

2014-02-03 Thread George Ant
Chris, thank you for your time. Your reply was really helpful! I followed your advice. I didn't sacrifice relational design (I didn't have this intention) and I used joins/views. Kind Regards, George Antonopoulos -- View this message in context: http://postgresql.1045698.n5.nabble.com/Compos

Re: [GENERAL] Composite type

2014-01-30 Thread George Ant
was looking for. I am actually trying to transform a RELATIONAL database to OBJECT-RELATIONAL. Can anybody provide me with any helpful link or suggest me some "must do" steps? (maybe I need to start a new post for this). Thank you again, George Ant -- View this message in context: htt