[GENERAL] count(*) in binary mode returns 0
I have an implementation of binary format communication that is working quite well but it is failing inexplicably on returning valid results for the aggregate function count. It returns a correct result for instance for the aggregate function max. Here is some debug information to illustrate that I have debugged the host order conversions and what have you in implementing this binary format. As you can see, it is simply returning 0. s:select count(*) from "User" where ("email" = $1) valsl 1 val_str:t...@t.com len:7 result received free_iter_pre alloc_result pre fname: count nfields: 1 from_psql bytes_to_read:4 read:4 host_order bytes_to_read:4 read:4 conv_int ir:0 fname: count
[GENERAL] Use environment variables in postgresql.conf
Is it possible to use environment variables in postgresql.conf and perhaps related configuration files? For example, I would like to use an env variable to specify the data directory.
Re: [GENERAL] Use environment variables in postgresql.conf
The questions are: 1. Has var expansion in configuration files been contemplated? 2. Why not do it? So the presumed workflow is that: 1. There is no support for environment variable expansion in configuration files 2. Use of environment variable values should only be passed to the "postgres" on the command line 3. Ie thus passed through to pg_ctl from the OS init scripts. Reasons why it's perhaps useful to change the presumed workflow: 1. It's perhaps inconvenient 2. Variables are a fundamental concept for configuration 3. Moving configuration to os specific scripts defies the DRY (don't repeat yourself) paradigm Proposed workflow: 1. Environment initialization, meaning the declaration of environment variables (in the sense that "env -i" is probably spawned in the OS specific scripts and is thus quite empty) for "pg_ctl" should be done in a postgresql specific shell file. 2. Variable expansion should be done in postgresql specific configuration files. On the other hand: 1. One could just generate the conf files 2. Assign env vars to absolute paths/symbolic links Thanks for your reply Andrew, however I do not necessarily wish to conform to arbitrary expectations forced by the current implementation if it is inconvenient/incomplete. Please evaluate the value of workflows facilitated by said modifications. Using the OS specific start up scripts for configuration of contexts they are intended to initiate is fundamentally incorrect. As specified, I do not like the declaration of "postgres" configuration as command-line options or as environment variables because said declarations invariably move away from the centrailization of postgresql configuration to the initailization scripts. However, considering the PGOPTIONS environment variable, I think it's initailization in a standardized way by the init scripts is the most relevant to this workflow. On Sat, Nov 30, 2013 at 8:06 PM, Andrew Sullivan wrote: > On Sat, Nov 30, 2013 at 06:54:31PM -0500, imagene...@gmail.com wrote: > > Is it possible to use environment variables in postgresql.conf and > perhaps > > related configuration files? > > > > For example, I would like to use an env variable to specify the data > > directory. > > On top of what John Pierce says in the thread, I would very strongly > urge you not to do this. It makes troubleshooting on failure > notoriously hard. Use the mechanisms the start-up files do, I > suggest. > > That said, see section 18 of the manual -- in particular, 18.1.3 in > the 9.3 manual ("Other ways to set parameters"). I recommend against > all that on the basis of some somewhat painful experience, but you can > do it that way. > > If you're determined to do it, I _strongly_ suggest using several > different postgres.conf files and then only using the config_file > parameter to control this. At least then you can look at what the > settings were when you have a crashed or otherwise troublesome system. > > Best, > > A > > -- > Andrew Sullivan > a...@crankycanuck.ca > > > -- > Sent via pgsql-general mailing list (pgsql-general@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-general >
[GENERAL] Scripts to build the various debian packages from postgresql source
I would like to build from source, however I would like to integrate with the scripts included in the ubuntu packages from https://wiki.postgresql.org/wiki/Apt. Where are the scripts that are used to build the various relevant packages from presumably these postgresql sources: http://www.postgresql.org/download/ For example, I have come up with the following configure parameters, but it would appear that the ubuntu packages provide source in different format as the /usr/include/postgresql directory contains files from the source includes that are presumably shared across versions of postgresql. $ver=9.3 $type=main ./configure --prefix=--bindir=/usr/lib/postgresql/$ver/ --datarootdir=/usr/share/postgresql/$ver --sysconfdir=/etc/postgresql/$ver/$type --includedir=/usr/include/postgresql/$ver unfortunately the include dir /usr/include/postgresql/ appears to be comprised of files provided by various packages I would prefer to build from a set of scripts instead of attempting to backwords engineer the build. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
Re: [GENERAL] Scripts to build the various debian packages from postgresql source
Typo of course: $ver=9.3 $type=main ./configure --prefix=/usr/lib/postgresql/$ver/ --datarootdir=/usr/share/postgresql/$ver --sysconfdir=/etc/postgresql/$ver/$type On Mon, Dec 16, 2013 at 3:47 PM, imagene...@gmail.com wrote: > I would like to build from source, however I would like to integrate > with the scripts included in the ubuntu packages from > https://wiki.postgresql.org/wiki/Apt. Where are the scripts that are > used to build the various relevant packages from presumably these > postgresql sources: > > http://www.postgresql.org/download/ > > > For example, I have come up with the following configure parameters, > but it would appear that the ubuntu packages provide source in > different format as the /usr/include/postgresql directory contains > files from the source includes that are presumably shared across > versions of postgresql. > > $ver=9.3 > $type=main > ./configure --prefix=--bindir=/usr/lib/postgresql/$ver/ > --datarootdir=/usr/share/postgresql/$ver > --sysconfdir=/etc/postgresql/$ver/$type > > --includedir=/usr/include/postgresql/$ver unfortunately the include > dir /usr/include/postgresql/ appears to be comprised of files provided > by various packages > > I would prefer to build from a set of scripts instead of attempting to > backwords engineer the build. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
Re: [GENERAL] Scripts to build the various debian packages from postgresql source
http://www.debian.org/doc/manuals/maint-guide/build.en.html Resolved. On Mon, Dec 16, 2013 at 3:53 PM, imagene...@gmail.com wrote: > Typo of course: > > $ver=9.3 > $type=main > ./configure --prefix=/usr/lib/postgresql/$ver/ > --datarootdir=/usr/share/postgresql/$ver > --sysconfdir=/etc/postgresql/$ver/$type > > On Mon, Dec 16, 2013 at 3:47 PM, imagene...@gmail.com > wrote: >> I would like to build from source, however I would like to integrate >> with the scripts included in the ubuntu packages from >> https://wiki.postgresql.org/wiki/Apt. Where are the scripts that are >> used to build the various relevant packages from presumably these >> postgresql sources: >> >> http://www.postgresql.org/download/ >> >> >> For example, I have come up with the following configure parameters, >> but it would appear that the ubuntu packages provide source in >> different format as the /usr/include/postgresql directory contains >> files from the source includes that are presumably shared across >> versions of postgresql. >> >> $ver=9.3 >> $type=main >> ./configure --prefix=--bindir=/usr/lib/postgresql/$ver/ >> --datarootdir=/usr/share/postgresql/$ver >> --sysconfdir=/etc/postgresql/$ver/$type >> >> --includedir=/usr/include/postgresql/$ver unfortunately the include >> dir /usr/include/postgresql/ appears to be comprised of files provided >> by various packages >> >> I would prefer to build from a set of scripts instead of attempting to >> backwords engineer the build. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
[GENERAL] search_path reset on error (making it not reset)
The search_path set for the connection is being reset if a query errors. Is there a setting to maintain the search_path despite errors.