Shoaib Mir wrote:
> Something like this will help you..
Or shorter:
> ===
>
> CREATE OR REPLACE FUNCTION public.check_table(varchar, varchar)
> RETURNS boolean AS $$
> DECLARE
> v_cnt integer;
> v_tbl boolean;
> BEGIN
PERFORM 1 FROM pg_tables where tablename = $1
Thanks, that's exactly what I was looking for :-)
kind regards,
Morirt
2007/1/15, A. Kretschmer <[EMAIL PROTECTED]>:
am Mon, dem 15.01.2007, um 13:18:11 +0100 mailte Moritz Bayer folgendes:
> Dear list,
>
> I would like to create a function which gets a tablename and checks if
the
> specifi
Something like this will help you..
===
CREATE OR REPLACE FUNCTION public.check_table(varchar, varchar)
RETURNS boolean AS $$
DECLARE
v_cnt integer;
v_tbl boolean;
BEGIN
SELECT count(1) INTO v_cnt FROM pg_tables where tablename = $1 and
schemaname = $2;
IF v_cnt
A. Kretschmer wrote:
> am Mon, dem 15.01.2007, um 13:18:11 +0100 mailte Moritz Bayer folgendes:
>> Dear list,
>>
>> I would like to create a function which gets a tablename and checks if the
>> specific table exists.The return value should be a bool.
>> Now I'm wondering how to do this the best
am Mon, dem 15.01.2007, um 13:18:11 +0100 mailte Moritz Bayer folgendes:
> Dear list,
>
> I would like to create a function which gets a tablename and checks if the
> specific table exists.The return value should be a bool.
> Now I'm wondering how to do this the best way.
>
> Any suggestions?
Dear list,
I would like to create a function which gets a tablename and checks if the
specific table exists.The return value should be a bool.
Now I'm wondering how to do this the best way.
Any suggestions?
kind regards and thanks in advance,
Moritz