create table sintax - Mailing list pgsql-general

From Júlio Almeida
Subject create table sintax
Date
Msg-id BANLkTim67wD0PE02KPFobpOkEUQ7p6WRng@mail.gmail.com
Whole thread Raw
Responses Re: create table sintax
List pgsql-general
Hello,
 
If I run
 
create table newtable (like oldtable including constraints);
 
in the SQL window with works just file.
But if i execute
 
execute 'create table '||newtable||' (LIKE '||oldtable||' including constraints)';
 
inside a function, in a LOOP, the constraints aren't created.
What is the problem?
Tanks,
 
julio almeida 
 
 


pgsql-general by date:

Previous
From: Nick Raj
Date:
Subject: Re: Typecast
Next
From: Frank van Vugt
Date:
Subject: Re: REASSIGN OWNED doesn't for all objects, ALTER FUNCTION seems to fix it