Re: bytea Issue - Reg - Mailing list pgsql-general

From Adrian Klaver
Subject Re: bytea Issue - Reg
Date
Msg-id 5392222D.8050607@aklaver.com
Whole thread Raw
In response to Re: bytea Issue - Reg  (sramay <nic.srama@gmail.com>)
List pgsql-general
On 06/04/2014 10:49 PM, sramay wrote:
> Sir,
>
> The base table is having bytea and having records around 32 lakhs shows size
> of 300 mb.
> bytea field has attached documents size is not shown in the base table.
>
> The message on  Tomcat is
>
> --begin text --
>
> 4 Jun, 2014 3:29:07 PM org.apache.catalina.core.StandardWrapperValve invoke
> INFO: WARN [TP-Processor24] JDBCExceptionReporter.logExceptions(100) | SQL
> Error: 0, SQLState: 42P01
> ERROR [TP-Processor24] JDBCExceptionReporter.logExceptions(101) | ERROR:
> relation "public.file_attachments" does not exist
>    Position: 238
> org.hibernate.exception.SQLGrammarException: could not execute query
>          at
> org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:90)
>          at
> org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
>          at org.hibernate.loader.Loader.doList(Loader.java:2231)
>          at
> org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125)
>          at org.hibernate.loader.Loader.list(Loader.java:2120)
>          at
> org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:118)
>          at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1596)
>          at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:306)
>          at
> org.hibernate.impl.CriteriaImpl.uniqueResult(CriteriaImpl.java:328)
>          at
> com.nic.edistrict.certificates.dao.impl.FileAttachmentsDaoImpl.getFileAttachments(FileAttachmentsDaoImpl.java:53)
>          at
>
com.nic.edistrict.certificates.service.impl.FileAttachmentsManagerImpl.getFileAttachments(FileAttachmentsManagerImpl.java:28)
>          at sun.reflect.GeneratedMethodAccessor1999.invoke(Unknown Source)
>          at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>          at java.lang.reflect.Method.invoke(Method.java:597)
>          at
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:28
>
> --end text


To add to Alan's comment about checking which database you are
connecting to, I have one:

In seems there are a couple of Java programs at work here, Hibernate and
the Spring Framework. I see something dealing with reflection and that
raises a flag.

Are you sure that the framework/Hibernate are doing the right thing?

>
> Even though table is present and connections are opening for subsequently.
> The message
> appear at frequent intervals.   Is there any way to see the complete size of
> a table
> which has bytea filed like database
> pg_size_pretty(pg_relation_size('file_attachments') shows
> just 300 mb.

http://www.postgresql.org/docs/9.1/interactive/functions-admin.html

pg_table_size accepts the OID or name of a table and returns the disk
space needed for that table, exclusive of indexes. (TOAST space, free
space map, and visibility map are included.)

>
> Any help is welcome.
>
> Regards
>
> Ramachandran s
>



--
Adrian Klaver
adrian.klaver@aklaver.com


pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Problem with locales on Linux with 9.3.4
Next
From: hubert depesz lubaczewski
Date:
Subject: Re: Problem with locales on Linux with 9.3.4