Re: Error Number in Function

From: "Sumita Biswas" <sbiswas(at)cisco(dot)com>
To: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Error Number in Function
Date: 2004-02-23 03:33:41
Message-ID: 001b01c3f9bd$d53dfb10$2a154d0a@apac.cisco.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Thanks for the clarification Tom.

I have one more query.
Is there a way to get the error number for the last Transact-SQL
statement executed in a Function in postgresql?
In MSSQL Stored Procedures we used @@ERROR variable to get the same. Is
there an equivalent in postgresql functions?

Regards,
Sumita

-----Original Message-----
From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Monday, February 23, 2004 8:59 AM
To: Sumita Biswas
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Postgres DB

"Sumita Biswas" <sbiswas(at)cisco(dot)com> writes:
> But when I type the command "psql" and don't specify a DB name, it
> says
> that:
> psql: FATAL: Database "postgres" does not exist in the system
catalog.

Yes, because psql's default behavior is to try to connect to the DB with
the same name as your user name. That doesn't mean that such a DB is
guaranteed to exist, or even that anything is going to try to create it
for you. It's just a default behavior that people have found handy.

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Christopher Browne 2004-02-23 04:07:13 Re: User defined types -- Social Security number...
Previous Message Tom Lane 2004-02-23 03:29:08 Re: Postgres DB