Number of Lines of Code (LOC)
To know the number of lines of codes in your PostgreSQL Database use PostgreSQL pgAdmin tool.
On the next step you should select database and select “Backup”.
On the 3rd step you should write filename, choose PLAIN format for backup and specify PLAIN options.
On the 4th step you can see the backup process. All objects from selected database export into specified file, which will contain generated statements, based on selected database objects, and data according to your specifications.
To create export SQL backup file click “Done”. After select the information from generated file and insert it into Query window in pgAdmin.
And in this SQL Worksheet window you can get the number of lines of codes.To get this number you have to go to the end of this file, click on the last line and in the lower right corner you can see the number of this last line. And it will be the number of lines of code in your sql-file.
So you can use generated sql-file to count the lines of codes of exported objects.