[GENERAL] numeric data type

2015-09-22 Thread Juan Pablo L .
Hi, i m writing a C module (extension), the procedure has a parameter that is of type numeric, inside the function i can not read the parameter or so it seems, this what is do: float8 db_balance,in_chgval; in_chgval = PG_GETARG_FLOAT8(2); elog(INFO,"in_chgval = %0.2f",in_chgval); The above

Re: [GENERAL] numeric data type

2015-09-22 Thread Tom Lane
"Juan Pablo L." writes: > Hi, i m writing a C module (extension), the procedure has a parameter that > is of type numeric, > inside the function i can not read the parameter or so it seems, this what is > do: > float8 db_balance,in_chgval; > in_chgval =

Re: [GENERAL] Queuing query

2015-09-22 Thread Jeff Janes
On Mon, Sep 21, 2015 at 3:51 PM, Steve Crawford < scrawf...@pinpointresearch.com> wrote: > While awaiting the awesomeness of the upcoming "skip locked" feature in > 9.5 I need to handle a work queue. > > Does anyone see any glaring issues or subtle nuances with the basic method > below which

Re: [GENERAL] how to show time zone with numerical offset in CSV log?

2015-09-22 Thread Adrian Klaver
On 09/22/2015 08:16 AM, Michael Zoet wrote: - Nachricht von Adrian Klaver - Datum: Tue, 22 Sep 2015 07:46:24 -0700 Zone names: Time zone names ('z') cannot be parsed. Some more digging found that DateTimeFormat can deal with Z which is either the

Re: [GENERAL] Queuing query

2015-09-22 Thread Steve Crawford
Thanks, Jeff. Like I said, this is the way-stripped-down version of the core query with things like "the_priority" and "the_work" standing for more complicated expressions. Lots of other stuff is going on to make sure we get a response, clear the queue, etc. and we will index appropriately. I'm

[GENERAL] Advise on memory usage limitation by PostgreSQL on Windows

2015-09-22 Thread Venkata Balaji N
Hello, We would like to know if there is any limitation around memory utilization by PostgreSQL on Windows systems. As of now, we do not have the details about the exact Windows version in use. Windows server is with 5 GB RAM and 4 CPUs (4 cores). PostgreSQL Version is 9.1.x which will possibly

[GENERAL] The curious case of two inserts, a shrinking xmax, and a ShareLock on transaction

2015-09-22 Thread Jeff Dik
Hi, I've been trying to understand this curious case of a shrinking xmax. Suppose we have two tables: foo and bar. CREATE TABLE foo ( foo_id text PRIMARY KEY NOT NULL ); CREATE TABLE bar ( bar_id text NOT NULL, foo_id text NOT NULL REFERENCES foo (foo_id) ON DELETE CASCADE ); ...

Re: [GENERAL] The curious case of two inserts, a shrinking xmax, and a ShareLock on transaction

2015-09-22 Thread Alvaro Herrera
Jeff Dik wrote: > I'd really love to learn: > > 1. Why the xmax for foo_id1 goes from 696 to 1 and what does that >mean? When two transactions want to lock the same row, the xmax field is a multixact, no longer a bare transaction ID. This is an object that resolves to multiple transaction

Re: [GENERAL] numeric data type

2015-09-22 Thread Alvaro Herrera
Juan Pablo L. wrote: > thank you for your answer, the function is declared as: > > FUNCTION wtt_discount_account(IN in_phonenumber varchar(20),IN in_balanceid > integer,IN in_chgval numeric(10,2)) > > i chose numeric because is supposed to be better for numbers/money > operations, supposed to

Re: [GENERAL] numeric data type

2015-09-22 Thread Alvaro Herrera
Juan Pablo L. wrote: > Hi Alvaro, thank you for your answer, PG_GETARG_NUMERIC does not exist .. > cant find it in the source code and when running i get > undefined symbol: PG_GETARG_NUMERIC. #include "utils/numeric.h" -- Álvaro Herrerahttp://www.2ndQuadrant.com/ PostgreSQL

Re: [GENERAL] numeric data type

2015-09-22 Thread Juan Pablo L .
Hi Alvaro, thank you for your answer, PG_GETARG_NUMERIC does not exist .. cant find it in the source code and when running i get undefined symbol: PG_GETARG_NUMERIC. > Date: Tue, 22 Sep 2015 18:11:26 -0300 > From: alvhe...@2ndquadrant.com > To: jpablolorenze...@hotmail.com > CC:

Re: [GENERAL] numeric data type

2015-09-22 Thread Juan Pablo L .
thank you for your answer, the function is declared as: FUNCTION wtt_discount_account(IN in_phonenumber varchar(20),IN in_balanceid integer,IN in_chgval numeric(10,2)) i chose numeric because is supposed to be better for numbers/money operations, supposed to be exact, i would not want to loose

Re: [GENERAL] Inject rows into query resultes

2015-09-22 Thread David G. Johnston
On Tue, Sep 22, 2015 at 6:22 PM, Alex Magnum wrote: > Hi, > I am having a problem where I need to inject rows into a query result. > That is > > I have a list of add records, lets say car listings which I select from a > table. The order of the results are given either by

[GENERAL] Inject rows into query resultes

2015-09-22 Thread Alex Magnum
Hi, I am having a problem where I need to inject rows into a query result. That is I have a list of add records, lets say car listings which I select from a table. The order of the results are given either by the user or default/initial. I now want to inject featured car adds after every 5th

[GENERAL] Re: pg_dump - postgre 9.2 and "server closed the connection unexpectedly"

2015-09-22 Thread Maycon Oliveira
Thanks for the answer. The pg_dump is running on the same machine as the database. Is a VPS running centos. the script is this one: https://wiki.postgresql.org/wiki/Automated_Backup_on_Linux im using the custom backups. -- View this message in context:

Re: [GENERAL] how to show time zone with numerical offset in CSV log?

2015-09-22 Thread Adrian Klaver
On 09/22/2015 06:31 AM, Michael Zoet wrote: Hi Charles, thanks for the quick response and it looked promising but did not work as expected. I can set the datestyle to ISO on database level but this does not seem to effect the way the CSV logs are written. I still get 2015-09-22 13:06:01.658

Re: [GENERAL] how to show time zone with numerical offset in CSV log?

2015-09-22 Thread Michael Zoet
Hi Charles, thanks for the quick response and it looked promising but did not work as expected. I can set the datestyle to ISO on database level but this does not seem to effect the way the CSV logs are written. I still get 2015-09-22 13:06:01.658 UTC (or CEST and so on) in the log

Re: [GENERAL] pgsql-95 repo in rsync

2015-09-22 Thread Devrim GÜNDÜZ
Hi, On Mon, 2015-09-21 at 12:46 +, Kjetil Nygård wrote: > > 1. rsync > Would it be possible to have PostgreSQL 9.5 in the rsync-repo? This is now done. Regards, -- Devrim GÜNDÜZ Principal Systems Engineer @ EnterpriseDB: http://www.enterprisedb.com PostgreSQL Danışmanı/Consultant, Red

[GENERAL] how to show time zone with numerical offset in CSV log?

2015-09-22 Thread Michael Zoet
Hello everybody, I am saving PostgreSQL log file data (CVS logs) with Logstash and Elasticsearch. My problem with this is that the time zone value is with the name of the time zone like 2015-09-22 12:02:59.836 CEST which Logstash can not process. What Logstash needs are date/time stamps

Re: [GENERAL] how to show time zone with numerical offset in CSV log?

2015-09-22 Thread Charles Clavadetscher
Hi > -Original Message- > From: pgsql-general-ow...@postgresql.org > [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Michael Zoet > Sent: Dienstag, 22. September 2015 12:07 > To: pgsql-general@postgresql.org > Subject: [GENERAL] how to show time zone with numerical offset in CSV

Re: [GENERAL] how to show time zone with numerical offset in CSV log?

2015-09-22 Thread Michael Zoet
Hi Tom, Michael Zoet writes: Is there a way to convince Postgres to write the date/time with numerical time zone values to the log files? Try something like log_timezone = '<-0400>+4' OK this points me in a directions I haven't read anything about in the Postgres

[GENERAL] pg_dump - postgre 9.2 and "server closed the connection unexpectedly"

2015-09-22 Thread Maycon Oliveira
Hi there. i´m using postgre for 2 years now and i started to have this *INTERMITENT* error from pg_dump: pg_dump: Dumping the contents of table "adm_log" failed: PQgetCopyData() failed. pg_dump: Error message from server: server closed the connection unexpectedly This probably means the

Re: [GENERAL] how to show time zone with numerical offset in CSV log?

2015-09-22 Thread Adrian Klaver
On 09/22/2015 07:04 AM, Michael Zoet wrote: On 09/22/2015 06:31 AM, Michael Zoet wrote: Hi Charles, thanks for the quick response and it looked promising but did not work as expected. I can set the datestyle to ISO on database level but this does not seem to effect the way the CSV logs are

Re: [GENERAL] how to show time zone with numerical offset in CSV log?

2015-09-22 Thread Charles Clavadetscher
Hi > thanks for the quick response and it looked promising but did not work > as expected. > > I can set the datestyle to ISO on database level but this does not > seem to effect the way the CSV logs are written. I still get > 2015-09-22 13:06:01.658 UTC (or CEST and so on) in the log files. And

Re: [GENERAL] how to show time zone with numerical offset in CSV log?

2015-09-22 Thread Michael Zoet
On 09/22/2015 06:31 AM, Michael Zoet wrote: Hi Charles, thanks for the quick response and it looked promising but did not work as expected. I can set the datestyle to ISO on database level but this does not seem to effect the way the CSV logs are written. I still get 2015-09-22 13:06:01.658

[GENERAL] could not load library liblwgeom-2.1.7.so

2015-09-22 Thread Willy-Bas Loos
Hi, We use the apt.postgresql.org repository for production (ubuntu) servers and something strange just ahppended when i was working on a new server. An upgrade of postgresql-9.3-postgis-2.1 just came in and since then postgis is broken, because it cannot find liblwgeom-2.1.7.so When i run a

Re: [GENERAL] how to show time zone with numerical offset in CSV log?

2015-09-22 Thread Adrian Klaver
On 09/22/2015 07:04 AM, Michael Zoet wrote: On 09/22/2015 06:31 AM, Michael Zoet wrote: Hi Charles, thanks for the quick response and it looked promising but did not work as expected. I can set the datestyle to ISO on database level but this does not seem to effect the way the CSV logs are

Re: [GENERAL] md5(large_object_id)

2015-09-22 Thread Karsten Hilbert
> I don't think that it is possible to stream the result of a query anyway, I was unclear. I don't expect query results to stream out to the client. I want the "SELECT md5(OID);" to return a single md5 hash value. It is already possible to "SELECT md5(lo_read(OID));" but that will read the entire

Re: [GENERAL] how to show time zone with numerical offset in CSV log?

2015-09-22 Thread Michael Zoet
- Nachricht von Adrian Klaver - Datum: Tue, 22 Sep 2015 07:46:24 -0700 Zone names: Time zone names ('z') cannot be parsed. Some more digging found that DateTimeFormat can deal with Z which is either the offset or the timezone id, in particular as

Re: [GENERAL] pgpass (in)flexibility

2015-09-22 Thread Peter Eisentraut
On 9/15/15 1:48 AM, Ben Chobot wrote: > We're in a situation where we would like to take advantage of the pgpass > hostname field to determine which password gets used. For example: > > psql -h prod-server -d foo # should use the prod password > psql -h beta-server -d foo # should use the beta

Re: [GENERAL] md5(large_object_id)

2015-09-22 Thread Willy-Bas Loos
On Mon, Sep 21, 2015 at 10:17 PM, Karsten Hilbert wrote: > I am dealing with radiology > studies aka DICOM data) one would want an md5 function which > streams in parts of a large object piece by piece using > md5_update and m5_finalize or some such. > > It didn't look

Re: [GENERAL] how to show time zone with numerical offset in CSV log?

2015-09-22 Thread Tom Lane
Michael Zoet writes: > Is there a way to convince Postgres to write the date/time with > numerical time zone values to the log files? Try something like log_timezone = '<-0400>+4' See the discussion of POSIX timezone names here:

Re: [GENERAL] pg_dump - postgre 9.2 and "server closed the connection unexpectedly"

2015-09-22 Thread Tom Lane
Maycon Oliveira writes: > i´m using postgre for 2 years now and i started to have this *INTERMITENT* > error from pg_dump: > pg_dump: Dumping the contents of table "adm_log" failed: PQgetCopyData() > failed. > pg_dump: Error message from server: server closed the connection

Re: [GENERAL] how to show time zone with numerical offset in CSV log?

2015-09-22 Thread Tom Lane
Michael Zoet writes: > Can you explain what '<-0400>+4' exactly means? It's a POSIX-style zone name specifying the STD abbreviation "-0400", UTC offset 4 hours west of Greenwich, and no DST behavior. > And why the string > '<+0200>-2' prints the date & time with the

Re: [GENERAL] how to show time zone with numerical offset in CSV log?

2015-09-22 Thread Michael Zoet
Hi Tom, And how can this automatically be changed if Germany switches from summer time (CEST with +0200) to winter time (CET +0100)? Well, you could write <+0200>-2<+0100> but I'm not sure I would recommend it. That would result in switching on the DST transition days specified in the

Re: [GENERAL] pgsql-95 repo in rsync

2015-09-22 Thread Kjetil Nygård
On ti., 2015-09-22 at 14:33 +0300, Devrim GÜNDÜZ wrote: Hi, On Mon, 2015-09-21 at 12:46 +, Kjetil Nygård wrote: 1. rsync Would it be possible to have PostgreSQL 9.5 in the rsync-repo? This is now done. Thanks a lot :-D -- Med vennleg helsing Kjetil Nygård Technical Expert | Ambita