Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2013-05

PostgreSQL and error codes

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Reinier Olislagers
to silvioprog
silvioprog wrote
How to get the error code of a data base error? I'm using the PostgreSQL.

You can catch db specific errors (descendends of EDatabaseError IIRC) in an exception - the postgresql descendent was extended with more properties that include the error code IIRC, or you can catch EDatabaseError but you won't have much detail; see SQLDBTutorial1 through 3 on the wiki - probably 2 - (it should be in at least one of them).... or of course check the documentation for sqldb.

Thanks,
Reinier

Reply by email

silvioprog
to Reinier Olislagers

2013/5/23 Reinier Olislagers

Show quoted text 13 lines
On 23-5-2013 3:11, silvioprog wrote: > How to get the error code of a data base error? I'm using the > PostgreSQL. You can catch db specific errors (descendends of EDatabaseError IIRC) in an exception - the postgresql descendent was extended with more properties that include the error code IIRC, or you can catch EDatabaseError but you won't have much detail; see SQLDBTutorial1 through 3 on the wiki - probably 2 - (it should be in at least one of them).... or of course check the documentation for sqldb. Thanks, Reinier

Very good explanation. I'm trying to implement it: https://github.com/mdbs99/Greyhound/issues/30. :)

I'll try it, thank you very much!

Silvio Clécio My public projects - github.com/silvioprog

Reply by email