create table sintax

From: Júlio Almeida <julio(dot)augusto(dot)almeida(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: create table sintax
Date: 2011-04-19 08:51:06
Message-ID: BANLkTim67wD0PE02KPFobpOkEUQ7p6WRng@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Frank van Vugt 2011-04-19 10:39:52 Re: REASSIGN OWNED doesn't for all objects, ALTER FUNCTION seems to fix it
Previous Message Nick Raj 2011-04-19 05:56:35 Re: Typecast