Обсуждение: Equivalent function not found forERROR_PROCEDURE(),ERROR_LINE(),ERROR_MESSAGE().

Поиск
Список
Период
Сортировка

Equivalent function not found forERROR_PROCEDURE(),ERROR_LINE(),ERROR_MESSAGE().

От
"MAJUMDER, SAYAN"
Дата:

Hi,

I am new to postgresql and presently we are migrating from sql server to postgresql.

We have certain functions in sql server such as ERROR_PROCEDURE(),ERROR_LINE(),ERROR_MESSAGE(). I am unable to find any equivalent

functions in postgresql. Kindly help me. Thanks in advance. Its urgent.

 

Thanks and regards,

Sayan Majumder.

 

This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.

Re: Equivalent function not found forERROR_PROCEDURE(),ERROR_LINE(),ERROR_MESSAGE().

От
John R Pierce
Дата:
On 3/27/2017 3:59 AM, MAJUMDER, SAYAN wrote:

I am new to postgresql and presently we are migrating from sql server to postgresql.

We have certain functions in sql server such as ERROR_PROCEDURE(),ERROR_LINE(),ERROR_MESSAGE(). I am unable to find any equivalent

functions in postgresql. Kindly help me. Thanks in advance. Its urgent.


I'm not familiar with those functions in Microsoft SQL Server, however see the various result functions in https://www.postgresql.org/docs/current/static/libpq-exec.html  such as PQresultStatus, PQresultErrorMessage, PQresultErrorField, etc, to get the error results of a query executed via the standard libpq API. 

If you are using a different API to access postgres, then you'd need to look into that API's error return functions.


-- 
john r pierce, recycling bits in santa cruz

Re: Equivalent function not found forERROR_PROCEDURE(),ERROR_LINE(),ERROR_MESSAGE().

От
Rob Sargent
Дата:
On 03/27/2017 04:59 AM, MAJUMDER, SAYAN wrote:

Hi,

I am new to postgresql and presently we are migrating from sql server to postgresql.

We have certain functions in sql server such as ERROR_PROCEDURE(),ERROR_LINE(),ERROR_MESSAGE(). I am unable to find any equivalent

functions in postgresql. Kindly help me. Thanks in advance. Its urgent.

 

Thanks and regards,

Sayan Majumder.

 

This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.


Seems you didn't like the "RAISE" option you were given on Stack Overflow.  You might explain what those functions do to allow postgres people to recognize any potential match.

Re: Equivalent function not found for ERROR_PROCEDURE(),ERROR_LINE(),ERROR_MESSAGE().

От
"David G. Johnston"
Дата:
On Tue, Mar 28, 2017 at 12:51 PM, Rob Sargent <robjsargent@gmail.com> wrote:
On 03/27/2017 04:59 AM, MAJUMDER, SAYAN wrote:

Hi,

I am new to postgresql and presently we are migrating from sql server to postgresql.

We have certain functions in sql server such as ERROR_PROCEDURE(),ERROR_LINE(),ERROR_MESSAGE(). I am unable to find any equivalent

functions in postgresql. Kindly help me. Thanks in advance. Its urgent.

Seems you didn't like the "RAISE" option you were given on Stack Overflow.  You might explain what those functions do to allow postgres people to recognize any potential match.

I think the OP is going to find a quick drop-off in the willingness of others to provide free help if the OP continues to blind cross-post and claim urgency for a migration.

I don't know exactly what materials exist for SQL Server migration to PostgreSQL but the first two questions asked of this list cover seemingly basic topics that I have to imagine search and/or reading the relevant sections of our documentation would provide reasonable answers for - or at least allow for the writing of better questions.

David J.

Re: Equivalent function not found forERROR_PROCEDURE(),ERROR_LINE(),ERROR_MESSAGE().

От
Adrian Klaver
Дата:
On 03/28/2017 12:51 PM, Rob Sargent wrote:
> On 03/27/2017 04:59 AM, MAJUMDER, SAYAN wrote:
>>
>> Hi,
>>
>> I am new to postgresql and presently we are migrating from sql server
>> to postgresql.
>>
>> We have certain functions in sql server such as
>> ERROR_PROCEDURE(),ERROR_LINE(),ERROR_MESSAGE(). I am unable to find
>> any equivalent
>>
>> functions in postgresql. Kindly help me. Thanks in advance. Its urgent.
>>
>>
>>
>> Thanks and regards,
>>
>> Sayan Majumder.
>>
>>
>>
>> This message contains information that may be privileged or
>> confidential and is the property of the Capgemini Group. It is
>> intended only for the person to whom it is addressed. If you are not
>> the intended recipient, you are not authorized to read, print, retain,
>> copy, disseminate, distribute, or use this message or any part
>> thereof. If you receive this message in error, please notify the
>> sender immediately and delete all copies of this message.
>>
>
> Seems you didn't like the "RAISE" option you were given on Stack
> Overflow.  You might explain what those functions do to allow postgres
> people to recognize any potential match.

The SQL Server functions:

https://docs.microsoft.com/en-us/sql/t-sql/functions/error-procedure-transact-sql

which at a quick look seem to be a combination of:

https://www.postgresql.org/docs/9.6/static/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING

and

https://www.postgresql.org/docs/9.6/static/plpgsql-errors-and-messages.html

--
Adrian Klaver
adrian.klaver@aklaver.com