Search Postgresql Archives

Debugging SQL queries

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




I have sometimes very long queries, for example in setup-purposed sql file where plenty of tables of a new database are created in a single transaction. 600 lines of code or more is common. Sometimes, while developing, an error may appear after submitting such a query for testing purposes via pgAdmin III query dialog. pgAdmin III displays the PostgreSQL error, like shown below (example)

   syntax error at or near "1" at character 2641

According my current PostgreSQL configuration error message looks similar in the log files:

2006-05-11 09:51:55 ERROR: syntax error at or near "1" at character 2641

My problem is that I don't know where the given character number is inside the query/file. I can search in my code editors (e.g. those of Eclipse IDE) for line number + character number in given line number... but I can not search for an overall character number. Counting all characters from 1 to 2641 or any other character number would be really frustrating in such big queries and it wouldn't be satisfying for me to split the sql file into multiple smaller queries. How can I configure PostgreSQL to get line number + character number in that line in the error statements, or which other solution may help?

Development version is PostgreSQL 8.1.3 on Windows XP Pro.

Many thanks!

Anastasios


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux