Re: [GENERAL] check table existence...

2007-01-15 Thread Alban Hertroys
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

Re: [GENERAL] check table existence...

2007-01-15 Thread Moritz Bayer
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

Re: [GENERAL] check table existence...

2007-01-15 Thread Shoaib Mir
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

Re: [GENERAL] check table existence...

2007-01-15 Thread Alban Hertroys
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

Re: [GENERAL] check table existence...

2007-01-15 Thread A. Kretschmer
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?

[GENERAL] check table existence...

2007-01-15 Thread Moritz Bayer
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