Re: floating point output

2019-09-08 Thread Tom Lane
Rob Sargent writes: > Below I show a floating point column from a recent query. > Here's my guess at what's happening in the formatting: > 1) scientific notation if smaller than 1.0e-04 (I’m not in the > very-much-larger-than-one world) > 2) 15 digits after the most signicant 0 > 3) remo

Re: floating point output

2019-09-08 Thread Rob Sargent
> On Sep 5, 2019, at 7:32 AM, Rob Sargent wrote: > > > >> On Sep 4, 2019, at 9:14 PM, Adrian Klaver wrote: >> >>> On 9/4/19 5:23 PM, Rob Sargent wrote: >>> I've found the description of floating point types (here >>>

Re: help formualting a query

2019-09-08 Thread Tom Lane
stan writes: > I have a table that contains a series of rows. Each row has a project key, > a start date, and an end date. There are multiple rows with different start > and end dates for each project. > I need to return something that contains, one row per project key, with the > min(star date)

help formualting a query

2019-09-08 Thread stan
I am having a hard time figuring out to do this, the SQL way. Doing in a procedural way with a foreach would be deasy, but I suspect that a properly formulated SQL query can achieve this. I have a table that contains a series of rows. Each row has a project key, a start date, and an end date. Th

Re: Convert a row to a nested JSON document containing all relations in PostgreSQL

2019-09-08 Thread Adrian Klaver
On 9/8/19 5:22 AM, Ali Alizadeh wrote: 1) What side are you talking about, the parent of the record or the children? the children. only one level of depth is fine. 2) What procedural language are you using? PL/pgSQL As I understand, I need to loop over all columns in the "NEW" record, fi

Re: Whan is it safe to mark a function PARALLEL SAFE?

2019-09-08 Thread Peter Geoghegan
On Sun, Sep 8, 2019 at 12:27 PM Tom Lane wrote: > > If an error is raised in one parallel worker, does this > > cause the other parallel workers to be immediately terminated? > > I think not, though I didn't work on that code. The error will > be reported to the parent backend, which will cause i

Re: Whan is it safe to mark a function PARALLEL SAFE?

2019-09-08 Thread Tom Lane
Jim Finnerty writes: > According to the documentation: > "Functions and aggregates must be marked PARALLEL UNSAFE if they write to > the database, access sequences, change the transaction state even > temporarily (e.g. a PL/pgSQL function which establishes an EXCEPTION block > to catch errors), or

Re: Convert a row to a nested JSON document containing all relations in PostgreSQL

2019-09-08 Thread Ali Alizadeh
> 1) What side are you talking about, the parent of the record or the > children? the children. only one level of depth is fine. > 2) What procedural language are you using? PL/pgSQL As I understand, I need to loop over all columns in the "NEW" record, find out if the column is a foreign key

Re: How to access Postgres .pgpass file from php?

2019-09-08 Thread rob stone
Hello Howard, On Sat, 2019-09-07 at 22:17 +, Howard Wells wrote: > I have my php files in the web root, and the Postgres 10 logon > credentials are in the php file. I want to put them outside the web > root for security, because a malicious robot could easily read the > credentials. > > Aft

Re: kind of a bag of attributes in a DB . . .

2019-09-08 Thread Chris Travers
On Sat, Sep 7, 2019 at 5:17 PM Albretch Mueller wrote: > Say, you get lots of data and their corresponding metadata, which in > some cases may be undefined or undeclared (left as an empty string). > Think of youtube json files or the result of the "file" command. > > I need to be able to "instant