From: | anushasrivastava03 <anushasrivastava03(at)yahoo(dot)co(dot)in> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | checking schema present or not by passing schema name as parameter |
Date: | 2013-06-06 11:24:27 |
Message-ID: | 1370517867251-5758131.post@n5.nabble.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
i am checking if schema present or not and passing schema name dynamically
but it's trowing an error :
CREATE OR REPLACE FUNCTION chkschema(schemaname text)
RETURNS boolean AS
$BODY$
DECLARE
i boolean;
BEGIN
EXECUTE 'SELECT exists(select schema_name FROM information_schema.schemata
WHERE schema_name = '||quote_ident(schemaname)||')'
INTO i ;
IF i THEN
return i;
else
return i;
end if;
end;
$BODY$
LANGUAGE plpgsql
ERROR: column "secc_master" does not exist
LINE 1: ...M information_schema.schemata WHERE schema_name = secc_maste...
^
--
View this message in context: http://postgresql.1045698.n5.nabble.com/checking-schema-present-or-not-by-passing-schema-name-as-parameter-tp5758131.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.
From | Date | Subject | |
---|---|---|---|
Next Message | Pavel Stehule | 2013-06-06 11:25:27 | Re: passing schema name and table name as parameter functions in postgresql 9.2 |
Previous Message | anushasrivastava03 | 2013-06-06 11:19:07 | passing schema name and table name as parameter functions in postgresql 9.2 |