Please help

2018-03-06 Thread Daulat Ram
Dear Experts,

Kndly help to resolve the issue reported during startup pgadmin4 server mode on 
ubuntu 16.04

dram@vipgadmin:~$ cd .pgadmin4
dram@vipgadmin:~/.pgadmin4$ chmod +x  
lib/python2.7/site-packages/pgadmin4/pgAdmin4.py
dram@vipgadmin:~/.pgadmin4$ chmod  
lib/python2.7/site-packages/pgadmin4/pgAdmin4.py
dram@vipgadmin:~/.pgadmin4$ chmod -R  
lib/python2.7/site-packages/pgadmin4/pgAdmin4.py
dram@vipgadmin:~/.pgadmin4$ sudo systemctl daemon-reload
dram@vipgadmin:~/.pgadmin4$  sudo systemctl enable pgadmin4
dram@vipgadmin:~/.pgadmin4$ sudo systemctl start pgadmin4
dram@vipgadmin:~/.pgadmin4$ sudo systemctl status  pgadmin4
● pgadmin4.service - Pgadmin4 Service
   Loaded: loaded (/etc/systemd/system/pgadmin4.service; enabled; vendor 
preset: enabled)
   Active: failed (Result: exit-code) since Mon 2018-03-05 23:57:24 PST; 10s ago
  Process: 14190 
ExecStart=/root/.pgadmin4/lib/python2.7/site-packages/pgadmin4/pgAdmin4.py 
(code=exited, status=200/CHDIR)
Main PID: 14190 (code=exited, status=200/CHDIR)

Mar 05 23:57:24 vipgadmin systemd[1]: Started Pgadmin4 Service.
Mar 05 23:57:24 vipgadmin systemd[1]: pgadmin4.service: Main process exited, 
code=exited, status=200/CHDIR
Mar 05 23:57:24 vipgadmin systemd[1]: pgadmin4.service: Unit entered failed 
state.
Mar 05 23:57:24 vipgadmin systemd[1]: pgadmin4.service: Failed with result 
'exit-code'.

Regards,
Daulat




Re: GIST index (polygon, point)

2018-03-06 Thread Laurenz Albe
ghiureai wrote:
> I have a short description bellow from Dev team regarding the behaviour of 
> gist index on the polygon column, looking to get some  feedback  from you:
>
> " I was expecting the <@(point,polygon) and @>(polygon,point) to be 
> indexable but they are not. see bellow query output ,
> the column is a polygon and the index is a gist index on the polygon column; 
> my understanding of the above query is that it says which operators would 
> cause that index to be used
>
> This SQL shows which operators are indexable:SELECT
>  pg_get_indexdef(ss.indexrelid, (ss.iopc).n, TRUE) AS index_col,
>  amop.amopopr::regoperator AS indexable_operator
> FROM pg_opclass opc, pg_amop amop,
>  (SELECT indexrelid, information_schema._pg_expandarray(indclass) AS iopc
>   FROM pg_index
>   WHERE indexrelid = 'caom2.Plane_energy_ib'::regclass) ss
> WHERE amop.amopfamily = opc.opcfamily AND opc.oid = (ss.iopc).x
> ORDER BY (ss.iopc).n, indexable_operator;
>
> We run  the SQL  in PG 9.5.3 and PG 10.2 we  the same result: only polygon vs 
> polygon is indexable (except the last entry which is distance operator).
> The work around for us was to change interval-contains-value from 
> polygon-contains-point (@> or <@ operator) to
> polygn-intersects-really-small-polygon (&&) in order to use the index, but I 
> was quite surprised that contains operators are not indexable!
> Note that this is using the built in polygon and not pgsphere (spoly)"

That sounds about right.

You could use a single-point polygon like '((1,1))'::polygon
and the <@ or && operator.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com



by mistake dropped physical file dropped for one table.

2018-03-06 Thread Rambabu V
Hi Team,

by mistake one physical file dropped for one of our table, as we do-not
have backup for this table we are getting below error.

ERROR:  could not open file "base/12669/16394": No such file or directory


please help us to recover the table.


Regards,

Rambabu Vakada,

PostgreSQL DBA.


need meta data table/command to find query log

2018-03-06 Thread Rambabu V
Hi Team,

Please help us to get the query log details from meta data table/command in
postgresql. aw we are not maintaining log files more than 2 days due to
lack of space.


And also please provide document or sop for database upgrade from 9.3 to
9.6, as our database size was 4.5 tb and having table spaces as well. as it
was production database system we do-not want to take any risk, please help
us on this as well.


Regards,

Rambabu Vakada,
PostgreSQL DBA.


Re: Please help

2018-03-06 Thread Tomas Vondra
Can you please use separate threads for your questions? That is, don't
start new thread by responding to an existing message (because the new
message then points using "References" header, which is what e-mail
clients use to group messages into threads). And use a proper subject
describing the issue ("Please help" tells people nothing).

That being said, how is this related to performance at all? It seems to
be about pgadmin, so please send it to pgadmin-support I guess.

regards

On 03/06/2018 09:01 AM, Daulat Ram wrote:
> Dear Experts,
> 
>  
> 
> Kndly help to resolve the issue reported during startup pgadmin4 server
> mode on ubuntu 16.04
> 
>  
> 
> dram@vipgadmin:~$ cd .pgadmin4
> 
> dram@vipgadmin:~/.pgadmin4$ chmod +x 
> lib/python2.7/site-packages/pgadmin4/pgAdmin4.py
> 
> dram@vipgadmin:~/.pgadmin4$ chmod 
> lib/python2.7/site-packages/pgadmin4/pgAdmin4.py
> 
> dram@vipgadmin:~/.pgadmin4$ chmod -R 
> lib/python2.7/site-packages/pgadmin4/pgAdmin4.py
> 
> dram@vipgadmin:~/.pgadmin4$ sudo systemctl daemon-reload
> 
> dram@vipgadmin:~/.pgadmin4$  sudo systemctl enable pgadmin4
> 
> dram@vipgadmin:~/.pgadmin4$ sudo systemctl start pgadmin4
> 
> dram@vipgadmin:~/.pgadmin4$ sudo systemctl status  pgadmin4
> 
> ● pgadmin4.service - Pgadmin4 Service
> 
>    Loaded: loaded (/etc/systemd/system/pgadmin4.service; enabled; vendor
> preset: enabled)
> 
>    Active: failed (Result: exit-code) since Mon 2018-03-05 23:57:24 PST;
> 10s ago
> 
>   Process: 14190
> ExecStart=/root/.pgadmin4/lib/python2.7/site-packages/pgadmin4/pgAdmin4.py
> (code=exited, status=200/CHDIR)
> 
> Main PID: 14190 (code=exited, status=200/CHDIR)
> 
>  
> 
> Mar 05 23:57:24 vipgadmin systemd[1]: Started Pgadmin4 Service.
> 
> Mar 05 23:57:24 vipgadmin systemd[1]: pgadmin4.service: Main process
> exited, code=exited, status=200/CHDIR
> 
> Mar 05 23:57:24 vipgadmin systemd[1]: pgadmin4.service: Unit entered
> failed state.
> 
> Mar 05 23:57:24 vipgadmin systemd[1]: pgadmin4.service: Failed with
> result 'exit-code'.
> 
>  
> 
> Regards,
> 
> Daulat
> 
>  
> 
>  
> 

-- 
Tomas Vondra  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



Re: by mistake dropped physical file dropped for one table.

2018-03-06 Thread Stephen Frost
Greetings,

* Rambabu V (ram.wis...@gmail.com) wrote:
> by mistake one physical file dropped for one of our table, as we do-not
> have backup for this table we are getting below error.
> 
> ERROR:  could not open file "base/12669/16394": No such file or directory
> 
> please help us to recover the table.

You're not likely able to recover that table.  To do so would require
completely stopping the system immediately and attempting to perform
filesystem maniuplation to "undelete" the file, or pull back chunks from
the filesystem which contain pieces of the file and attempting to
reconstruct it.

If you've been keeping all WAL since the beginning of the cluster, it's
possible you could recover that way, but you claim to not have any
backups, so I'm guessing that's pretty unlikely.

Thanks!

Stephen


signature.asc
Description: PGP signature


Re: need meta data table/command to find query log

2018-03-06 Thread Stephen Frost
Greetings,

These questions are not appropriate for the 'performance' mailing list
but should be either on 'admin' or 'general'.  Please use the
appropriate list for asking questions in the future.

* Rambabu V (ram.wis...@gmail.com) wrote:
> Please help us to get the query log details from meta data table/command in
> postgresql. aw we are not maintaining log files more than 2 days due to
> lack of space.

It's entirely unclear what you are asking for here when you say "meta
data."  Information about tables is stored in the system catalog,
particularly the "pg_class" and "pg_attribute" tables, but that's
independent from the WAL.  To read the WAL files, you can use pg_waldump
(or pg_xlogdump on older versions), though that's not 'meta' data.

> And also please provide document or sop for database upgrade from 9.3 to
> 9.6, as our database size was 4.5 tb and having table spaces as well. as it
> was production database system we do-not want to take any risk, please help
> us on this as well.

You'll likely want to use pg_upgrade to perform such an upgrade:

https://www.postgresql.org/docs/10/static/pgupgrade.html

Thanks!

Stephen


signature.asc
Description: PGP signature


Re: by mistake dropped physical file dropped for one table.

2018-03-06 Thread Rambabu V
Ok, thanks.

On Mar 6, 2018 6:51 PM, "Stephen Frost"  wrote:

> Greetings,
>
> * Rambabu V (ram.wis...@gmail.com) wrote:
> > by mistake one physical file dropped for one of our table, as we do-not
> > have backup for this table we are getting below error.
> >
> > ERROR:  could not open file "base/12669/16394": No such file or directory
> >
> > please help us to recover the table.
>
> You're not likely able to recover that table.  To do so would require
> completely stopping the system immediately and attempting to perform
> filesystem maniuplation to "undelete" the file, or pull back chunks from
> the filesystem which contain pieces of the file and attempting to
> reconstruct it.
>
> If you've been keeping all WAL since the beginning of the cluster, it's
> possible you could recover that way, but you claim to not have any
> backups, so I'm guessing that's pretty unlikely.
>
> Thanks!
>
> Stephen
>