[SQL] regarding debugging?

2006-01-29 Thread AKHILESH GUPTA
hi all, i have a query regarding debbuging in PGSQL. just like there is  a debugger in C/C++, where we can check the execution of our program or we can dry run our code, is there aby option or feature with PGSQL for the same purpose that we can check our PGSQL statements? thanks in advance.

Re: [SQL] variable scooping

2006-01-29 Thread Michael Fuhr
On Mon, Jan 30, 2006 at 09:01:37AM +0700, ody quraviharto wrote: > "declare tbl_name varchar:='tbl_A'; > begin > if exists(select 1 from pg_tables where tablename=tbl_name) then > select count(*) from tbl_name; > end if; > end" > > the message was: syntax

Re: [SQL] [GENERAL] How to find a temporary table

2006-01-29 Thread Pandurangan R S
http://archives.postgresql.org/pgsql-general/2006-01/msg01259.php On 1/27/06, Emil Rachovsky <[EMAIL PROTECTED]> wrote: > > Hi, > I am using PostgreSQL 8.1.0 . How can I find a temp > table from my session, having the name of the table? > Can anyone show me what query should I execute? I've > tri

[SQL] UPDATE with correlated aggregates

2006-01-29 Thread Joe Abbate
Hi, I have a database with one "main" table with three columns that self-reference the primary key, plus four other tables that have (in total) seven foreign key columns referencing "main". I want to create a table (or view) that summarizes the various reference counts, per row in "main". I

[SQL] Question about check constraints

2006-01-29 Thread Kashmira Patel \(kupatel\)
Hi all,   I have a table where two columns have two different check constraints associated with them. When I update one column, the check constraint on the other column is also executed. Is there a way to avoid this? I want to check only for the condition defined for the column being update

Re: [SQL] [GENERAL] hi all......................!!

2006-01-29 Thread Tino Wildenhain
AKHILESH GUPTA schrieb: > hello everybody > i am new to this mailing list. this is my first mail to this group. > i jussst want to confirm that whether is it possible to update a view or > not?? > i think you all help me in solving my queries in future...!! Yes it is. All you have

Re: [SQL] How to implement Microsoft Access boolean (YESNO)

2006-01-29 Thread Bath, David
On Tue, 24 Jan 2006 07:53, Greg Stark wrote: > > Having checked the I/O format it seems that MS Access exports the > > values of a YESNO field as 0 and 1 Hmmm. I may be wrong, but last time I looked (a year or so ago), when I cast MS-Access yes/no fields to numerics, it gave me 0=no or all_bits_o

[SQL] variable scooping

2006-01-29 Thread ody quraviharto
hi all, I'm a newbie in postgresql. I've tried to make function but having trouble in variable scooping. here is the code in plpgsql: "declare tbl_name varchar:='tbl_A'; begin if exists(select 1 from pg_tables where tablename=tbl_name) then select count(*) from tbl_

Re: [SQL] Function with default value?

2006-01-29 Thread Daniel CAUNE
> -Message d'origine- > De : Tom Lane [mailto:[EMAIL PROTECTED] > Envoyé : dimanche 29 janvier 2006 10:48 > À : Daniel CAUNE > Cc : pgsql-sql@postgresql.org > Objet : Re: [SQL] Function with default value? > > Daniel CAUNE <[EMAIL PROTECTED]> writes: > > Is it possible to define a function

Re: [SQL] Function with default value?

2006-01-29 Thread Tom Lane
Daniel CAUNE <[EMAIL PROTECTED]> writes: > Is it possible to define a function with some default values? > CREATE OR REPLACE FUNCTION foo(i IN int, j IN int DEFAULT := 1) No. But you can fake many versions of this with a family of functions: CREATE OR REPLACE FUNCTION foo(i IN int, j IN int) ...

[SQL] Function with default value?

2006-01-29 Thread Daniel CAUNE
Hi,   Is it possible to define a function with some default values?   CREATE OR REPLACE FUNCTION foo(i IN int, j IN int DEFAULT := 1) …   Anyway, I didn’t find such a feature described in the PostgreSQL 8.1 documentation, but sometimes, that doesn’t mean that the feature doesn’t exis