[GENERAL] What query currently running within function

2014-07-22 Thread Rebecca Clarke
Hi all, Presently I'm executing a function that runs many queries within it. select * from _myfunction(); Is there a way to see what query it is up to within the function? When I do a select of pg_stat_activity it just shows me the _myfunction() query. I'm running postgresql 9.1 Thanks in

Re: [GENERAL] What query currently running within function

2014-07-22 Thread Guillaume Lelarge
Hi, 2014-07-22 11:36 GMT+02:00 Rebecca Clarke r.clark...@gmail.com: Hi all, Presently I'm executing a function that runs many queries within it. select * from _myfunction(); Is there a way to see what query it is up to within the function? Unfortunately, no. Even with the latest

[GENERAL] hstore/jsonb support in hibernate/JPA

2014-07-22 Thread Martin Gudmundsson
Hi all! I saw that Rails 4 comes with hstore support out of the box. Does anyone know if there’s any integrated support like that in hibernate or any other JPA implementation? I know your able to write your own custom datatypes, but I’m looking for integrated standardized support in the base

Re: [GENERAL] Referencing serial col's sequence for insert

2014-07-22 Thread rob stone
On Mon, 2014-07-21 at 10:00 +0800, Anil Menon wrote: Hi, I have a question on the right/correct practice on using the serial col's sequence for insert. Best way of explanation is by an example: create table id01 (col1 serial, col2 varchar(10)); insert into id01(col2) values

Re: [GENERAL] Referencing serial col's sequence for insert

2014-07-22 Thread Albe Laurenz
rob stone wrote: I have a question on the right/correct practice on using the serial col's sequence for insert. Best way of explanation is by an example: create table id01 (col1 serial, col2 varchar(10)); insert into id01(col2) values ( 'data'|| currval('id01_col1_seq')::varchar); while

Re: [GENERAL] Need r_constraint_name

2014-07-22 Thread Adrian Klaver
On 07/22/2014 03:12 AM, Ramesh T wrote: thank u , SELECT constraint_name FROM information_schema.table_constraints AS tc WHERE tc.table_name = p_table_name AND constraint_name IN (SELECT constraint_name FROM

Re: [GENERAL] Referencing serial col's sequence for insert

2014-07-22 Thread David G Johnston
Albe Laurenz *EXTERN* wrote Also, I think that your method is vulnerable to race conditions: If somebody else increments the sequence between the INSERT and SELECT lastval() you'd get a wrong value. Uh, no. It returns that last value issued in the same session - which is race-proof.

Re: [GENERAL] Referencing serial col's sequence for insert

2014-07-22 Thread rob stone
On Tue, 2014-07-22 at 13:32 +, Albe Laurenz wrote: rob stone wrote: I have a question on the right/correct practice on using the serial col's sequence for insert. Best way of explanation is by an example: create table id01 (col1 serial, col2 varchar(10)); insert into

Re: [GENERAL] check database integrity

2014-07-22 Thread Torsten Förtsch
On 21/07/14 16:17, Tom Lane wrote: db=# select page_header(get_raw_page(2836::oid::regclass::text, 'fsm', 1)); ERROR: block number 1 is out of range for relation pg_toast_1255 db=# select pg_relation_size(2836::oid::regclass, 'fsm'); pg_relation_size --

Re: [GENERAL] Referencing serial col's sequence for insert

2014-07-22 Thread David G Johnston
On Tuesday, July 22, 2014, rob stone-2 [via PostgreSQL] ml-node+s1045698n5812384...@n5.nabble.com wrote: On Tue, 2014-07-22 at 13:32 +, Albe Laurenz wrote: rob stone wrote: I have a question on the right/correct practice on using the serial col's sequence for insert. Best

Re: [GENERAL] Referencing serial col's sequence for insert

2014-07-22 Thread Albe Laurenz
David G Johnston wrote: Also, I think that your method is vulnerable to race conditions: If somebody else increments the sequence between the INSERT and SELECT lastval() you'd get a wrong value. Uh, no. It returns that last value issued in the same session - which is race-proof.

Re: Fwd: [GENERAL] Need r_constraint_name

2014-07-22 Thread Adrian Klaver
On 07/22/2014 07:21 AM, Ramesh T wrote: -- Forwarded message -- From: *Ramesh T* rameshparnandit...@gmail.com mailto:rameshparnandit...@gmail.com Date: Tue, Jul 22, 2014 at 7:50 PM Subject: Re: [GENERAL] Need r_constraint_name To: Adrian Klaver adrian.kla...@aklaver.com

Re: [GENERAL] check database integrity

2014-07-22 Thread Tom Lane
=?ISO-8859-1?Q?Torsten_F=F6rtsch?= torsten.foert...@gmx.net writes: On 21/07/14 16:17, Tom Lane wrote: Could you trace through it and see where the results diverge? Also, what's the actual size of the file on disk? After a fresh restart of the database I attached strace to the backend.

Re: [GENERAL] Referencing serial col's sequence for insert

2014-07-22 Thread David Johnston
On Tue, Jul 22, 2014 at 9:46 AM, Anil Menon gakme...@gmail.com wrote: Am a bit confused -which one comes first? 1) the 'data'||currval('id01_col1_seq') is parsed first : which means it takes the current session's currval 2) then the insert is attempted which causes a sequence.nextval to be

Re: [GENERAL] Need r_constraint_name

2014-07-22 Thread Ramesh T
thank u , SELECT constraint_name FROM information_schema.table_constraints AS tc WHERE tc.table_name = p_table_name AND constraint_name IN (SELECT constraint_name FROM information_schema.table_constraints AS tc

Re: [GENERAL] Referencing serial col's sequence for insert

2014-07-22 Thread Anil Menon
Am a bit confused -which one comes first? 1) the 'data'||currval('id01_col1_seq') is parsed first : which means it takes the current session's currval 2) then the insert is attempted which causes a sequence.nextval to be performed which means that 'data'||currval('id01_col1_seq')will be different

[GENERAL] question about memory usage

2014-07-22 Thread klo uo
Hi, I run Windows and I started using 64 bit PostgreSQL 9.3 a month ago. I have several PostGIS databases on localhost, with these statistics: === Xact XactRolled Blocks Blocks TuplesTuples

Fwd: [GENERAL] Need r_constraint_name

2014-07-22 Thread Ramesh T
-- Forwarded message -- From: Ramesh T rameshparnandit...@gmail.com Date: Tue, Jul 22, 2014 at 7:50 PM Subject: Re: [GENERAL] Need r_constraint_name To: Adrian Klaver adrian.kla...@aklaver.com Just i'm retriving the constraint_name when i enter child_table_name for inner query

Re: [GENERAL] check database integrity

2014-07-22 Thread Torsten Förtsch
On 22/07/14 16:58, Tom Lane wrote: Doh. I looked right at this code in get_raw_page yesterday: if (blkno = RelationGetNumberOfBlocks(rel)) elog(ERROR, block number %u is out of range for relation \%s\, blkno, RelationGetRelationName(rel));

Re: [GENERAL] question about memory usage

2014-07-22 Thread Bill Moran
On Wed, 23 Jul 2014 00:16:47 +0200 klo uo klo...@gmail.com wrote: Looking in process explorer, I see unusual size for postgres server process, i.e. working set reported around 1GB: http://i.imgur.com/HmkvFLM.png (same in attachment) I also use SqlExpress server with several databases

[GENERAL] PSQL Server couldn't start

2014-07-22 Thread Kalai R
Hi, I am facing a serious problem with postgresql frequently. I am using postgresql 9.3 in Windows OS with VisualStudio. we have more customers. We shutting down the system properly. But when we booting system, postgresql service didn't start. This happens frequently after we install. log

Re: [GENERAL] check database integrity

2014-07-22 Thread Tom Lane
=?ISO-8859-1?Q?Torsten_F=F6rtsch?= torsten.foert...@gmx.net writes: On 22/07/14 16:58, Tom Lane wrote: RelationGetNumberOfBlocks reports the length of the main fork ... but this check is applied regardless of which fork we're reading. Should be using RelationGetNumberOfBlocksInFork, of

Re: [GENERAL] PSQL Server couldn't start

2014-07-22 Thread Adrian Klaver
On 07/22/2014 09:01 PM, Kalai R wrote: Hi, I am facing a serious problem with postgresql frequently. I am using postgresql 9.3 in Windows OS with VisualStudio. we have more customers. We shutting down the system properly. But when we booting system, postgresql service didn't start. This

Re: [GENERAL] Question regarding log files in postgresql

2014-07-22 Thread lucas.g...@gmail.com
Hi again, it's deployed to a Ubuntu image, but we're using chef to configure the box. I know for a fact that chef starts and stops Postgresql multiple times during the install so I'm pretty sure the MAIN log is from the initial start, thank you too David G for pointing that out. My next question