Re: [GENERAL] Count column with name 'count' returns multiple rows. Why?

2017-08-18 Thread David G. Johnston
On Fri, Aug 18, 2017 at 1:47 PM, Peter J. Holzer wrote: > So apparently > ​ ​ > columnname open-parenthesis tablename closed-parenthesis is a specific > syntactic construct, but I can't find it documented anywhere. ​The documentation linked to speaks mainly in terms of

Re: [GENERAL] Count column with name 'count' returns multiple rows. Why?

2017-08-18 Thread Justin Pryzby
On Fri, Aug 18, 2017 at 10:47:37PM +0200, Peter J. Holzer wrote: > On 2017-08-18 06:37:15 -0500, Justin Pryzby wrote: > > On Fri, Aug 18, 2017 at 01:01:45PM +0200, Rob Audenaerde wrote: > > > I don't understand why this query: > > > > > >select count(base.*) from mytable base; > > > > > >

Re: [GENERAL] Count column with name 'count' returns multiple rows. Why?

2017-08-18 Thread Peter J. Holzer
On 2017-08-18 06:37:15 -0500, Justin Pryzby wrote: > On Fri, Aug 18, 2017 at 01:01:45PM +0200, Rob Audenaerde wrote: > > I don't understand why this query: > > > >select count(base.*) from mytable base; > > > > does return multiple rows. > > > >select count(1) from mytable base; > > >

Re: [GENERAL] archive_command fails but works outside of Postgres

2017-08-18 Thread twoflower
Mark Watson-12 wrote > I think the parameter %p contains the complete path of the file It does not, see the link to the official documentation above. -- View this message in context: http://www.postgresql-archive.org/archive-command-fails-but-works-outside-of-Postgres-tp5979040p5979061.html

Re: [GENERAL] archive_command fails but works outside of Postgres

2017-08-18 Thread twoflower
Alvaro Herrera-9 wrote > I saw one installation with "gsutil cp" in archive_command recently. > Ithad the CLOUDSDK_PYTHON environment variable set in the > archive_commanditself. Maybe that's a problem. That's not the case here, I don't have this variable set anywhere where gsutil works. Alvaro

Re: [GENERAL] archive_command fails but works outside of Postgres

2017-08-18 Thread twoflower
Scott Marlowe-2 wrote > Sounds like it depends on some envvar it doesn't see when run from the > postmaster. If you sudo -u postgres and run it does it work? Yes, I can do su postgres, execute the command and it works. -- View this message in context:

Re: [GENERAL] Results interpretation

2017-08-18 Thread Vincenzo Romano
Il 18 ago 2017 21:59, "Vincenzo Romano" ha scritto: Il 18 ago 2017 21:08, "Igor Korot" ha scritto: Hi, Vincenzo, On Fri, Aug 18, 2017 at 2:52 PM, Vincenzo Romano wrote: > What I can tell you is not more of what

Re: [GENERAL] Results interpretation

2017-08-18 Thread Vincenzo Romano
Il 18 ago 2017 21:08, "Igor Korot" ha scritto: Hi, Vincenzo, On Fri, Aug 18, 2017 at 2:52 PM, Vincenzo Romano wrote: > What I can tell you is not more of what is in the documentation. > > https://www.postgresql.org/docs/9.6/static/libpq-exec.

Re: [GENERAL] archive_command fails but works outside of Postgres

2017-08-18 Thread Mark Watson
De : pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] De la part de twoflower Envoyé : Friday, August 18, 2017 2:40 PM À : pgsql-general@postgresql.org Objet : [GENERAL] archive_command fails but works outside of Postgres I changed my archive_command to the

Re: [GENERAL] archive_command fails but works outside of Postgres

2017-08-18 Thread Alvaro Herrera
Scott Marlowe wrote: > On Fri, Aug 18, 2017 at 12:40 PM, twoflower wrote: > > I changed my archive_command to the following: > > > > archive_command = 'gsutil cp /storage/postgresql/9.6/main/%p > > gs://my_bucket/pg_xlog/' > > 2017-08-18 18:34:25.057 GMT [1436][0]:

Re: [GENERAL] archive_command fails but works outside of Postgres

2017-08-18 Thread Scott Marlowe
On Fri, Aug 18, 2017 at 12:40 PM, twoflower wrote: > I changed my archive_command to the following: > > archive_command = 'gsutil cp /storage/postgresql/9.6/main/%p > gs://my_bucket/pg_xlog/' > > and it fails, leaving the following in the log: > > 2017-08-18 18:34:25.057

Re: [GENERAL] Results interpretation

2017-08-18 Thread Igor Korot
Hi, Vincenzo, On Fri, Aug 18, 2017 at 2:52 PM, Vincenzo Romano wrote: > What I can tell you is not more of what is in the documentation. > > https://www.postgresql.org/docs/9.6/static/libpq-exec.html#LIBPQ-EXEC-SELECT-INFO > > > In particular see the function

Re: [GENERAL] Results interpretation

2017-08-18 Thread Vincenzo Romano
What I can tell you is not more of what is in the documentation. https://www.postgresql.org/docs/9.6/static/libpq-exec. html#LIBPQ-EXEC-SELECT-INFO In particular see the function PQBinaryTuples. -- Vincenzo Romano - NotOrAnd.IT Information Technologies -- NON QVIETIS MARIBVS NAVTA PERITVS Il

Re: [GENERAL] Results interpretation

2017-08-18 Thread Igor Korot
Hi, Vincenzo, On Fri, Aug 18, 2017 at 1:51 PM, Vincenzo Romano wrote: > Afaik, pgresult structure and it's fields are not meant to be handled > directly apart of comparing the pointer to null. So if I want to get an integer value with PQgetValue() I don't need to do

[GENERAL] archive_command fails but works outside of Postgres

2017-08-18 Thread twoflower
I changed my archive_command to the following: archive_command = 'gsutil cp /storage/postgresql/9.6/main/%p gs://my_bucket/pg_xlog/' and it fails, leaving the following in the log: 2017-08-18 18:34:25.057 GMT [1436][0]: [104319] LOG: archive command failed with exit code 12017-08-18 18:34:25.057

Re: [GENERAL] make postgresql 9.5 default on centos 7

2017-08-18 Thread Scott Marlowe
On Fri, Aug 18, 2017 at 11:50 AM, Steve Clark wrote: > Hi List, > > I loaded 9.5 on CentOS 7 but by default every thing wants to use the default > 9.2 version that comes with CentOS 7. > > Is there a simple way to fix this so the 9.5 version of tools and libraries >

Re: [GENERAL] make postgresql 9.5 default on centos 7

2017-08-18 Thread Melvin Davidson
On Fri, Aug 18, 2017 at 1:50 PM, Steve Clark wrote: > Hi List, > > I loaded 9.5 on CentOS 7 but by default every thing wants to use the > default > 9.2 version that comes with CentOS 7. > > Is there a simple way to fix this so the 9.5 version of tools and > libraries

Re: [GENERAL] Results interpretation

2017-08-18 Thread Vincenzo Romano
Afaik, pgresult structure and it's fields are not meant to be handled directly apart of comparing the pointer to null. -- Vincenzo Romano - NotOrAnd.IT Information Technologies -- NON QVIETIS MARIBVS NAVTA PERITVS Il 18 ago 2017 19:46, "Igor Korot" ha scritto: > Hi, > I

[GENERAL] make postgresql 9.5 default on centos 7

2017-08-18 Thread Steve Clark
Hi List, I loaded 9.5 on CentOS 7 but by default every thing wants to use the default 9.2 version that comes with CentOS 7. Is there a simple way to fix this so the 9.5 version of tools and libraries are used. Thanks, Steve -- Sent via pgsql-general mailing list

[GENERAL] Results interpretation

2017-08-18 Thread Igor Korot
Hi, I looked at the documentation, but couldn't find it. If I do PQexec() call, the results will be interpreted as binary or text? I'm trying to get an int field from the query and wonder if I need to do hton() call or not? Thank you. -- Sent via pgsql-general mailing list

Re: [GENERAL] Count column with name 'count' returns multiple rows. Why?

2017-08-18 Thread Justin Pryzby
On Fri, Aug 18, 2017 at 01:01:45PM +0200, Rob Audenaerde wrote: > I don't understand why this query: > >select count(base.*) from mytable base; > > does return multiple rows. > >select count(1) from mytable base; > > returns the proper count. > > There is a column with the name

[GENERAL] Count column with name 'count' returns multiple rows. Why?

2017-08-18 Thread Rob Audenaerde
Hi all, I don't understand why this query: select count(base.*) from mytable base; does return multiple rows. select count(1) from mytable base; returns the proper count. There is a column with the name 'count'. Can anyone please explain this behaviour? Steps to reproduce: create

[GENERAL] Number of rows affected by ON CASCADE

2017-08-18 Thread Dan
Hi, When I do a DELETE FROM table WHERE ...; I get the number of rows deleted in that table. How do I get the total number of rows deleted in the database by foreign keys with the ON CASCADE option? Thanks, Daniel -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make