[SQL] PL/SQL-to-PL/PgSQL-HOWTO beta Available

2001-02-17 Thread Roberto Mello
Hi all, I finished the beta version of my PL/SQL-to-PL/PgSQL-HOWTO last night and put it in http://www.brasileiro.net/roberto/howto . It explains basic differences between Oracle's PL/SQL and PG's PL/PgSQL and how to port apps from one to the other. It also includes my ins

Re: [SQL] How to clone a table to an empty one

2001-02-17 Thread Tom Lane
Ramiro Alba <[EMAIL PROTECTED]> writes: > I would need to create an exact reproduction of a certain table > (excluding data) converving primary key attributes and so on. Try pg_dump -s -t tablename dbname | psql dbname There is no easy way to do this directly in SQL ...

[SQL] How to clone a table to an empty one

2001-02-17 Thread Ramiro Alba
Hello everyone: I would need to create an exact reproduction of a certain table (excluding data) converving primary key attributes and so on. I tried with: CREATE TABLE AS ... I also tried : SELECT * INTO TABLE In both cases, it does not maintain the primary key atribute that I need in or