Re: [HACKERS] [GENERAL] CLOB BLOB limitations in PostgreSQL

2014-04-14 Thread David G Johnston
Bruce Momjian wrote On Mon, Apr 14, 2014 at 02:01:19PM +0200, Ivan Voras wrote: On 11/04/2014 16:45, Jack.O' Sullivan@ wrote: With point two, does this mean that any table with a bytea datatype is limited to 4 billion rows (which would seem in conflict with the unlimited rows shown

Re: [HACKERS] Patch: iff - if

2014-04-15 Thread David G Johnston
Thom Brown-2 wrote On 15 April 2014 23:19, Andreas 'ads' Scherbaum lt; adsmail@ gt; wrote: Hi, stumbled over a number of iff in the source where if is meant - not sure what the real story behind this is, but attached is a patch to fix the about 80 occurrences. This only appears in

Re: [HACKERS] The question about the type numeric

2014-04-15 Thread David G Johnston
sure.postgres wrote Hi hackers, I am learning about numeric . The comment of NumericShort format is: * In the NumericShort format, the remaining 14 bits of the header word * (n_short.n_header) are allocated as follows: 1 for sign (positive or * negative), 6 for dynamic scale, and 7 for

Re: [HACKERS] DISCARD ALL (Again)

2014-04-17 Thread David G Johnston
Alvaro Herrera-9 wrote Are we going to backpatch a doc change that says releases all temporary resources, except for plptyhon's and plperl's GD? Surely not ... GD = Global Dictionary I don't see why something like the following wouldn't have value. For those languages that make use of a

Re: [HACKERS] DISCARD ALL (Again)

2014-04-17 Thread David G Johnston
On 04/17/2014 05:24 PM, Tom Lane wrote: On the whole I'm not sure this is something we ought to get into. If you really need a fresh session, maybe you should start a fresh session. Isn't the whole point to avoid the reconnection overhead, especially for connection poolers? DISCARD ALL

Re: [HACKERS] Clock sweep not caching enough B-Tree leaf pages?

2014-04-21 Thread David G Johnston
Jim Nasby-2 wrote I feel that if there is no memory pressure, frankly it doesnt matter much about what gets out and what not. The case I am specifically targeting is when the clocksweep gets to move about a lot i.e. high memory pressure workloads. Of course, I may be totally wrong here.

Re: [HACKERS] Perfomance degradation 9.3 (vs 9.2) for FreeBSD

2014-04-21 Thread David G Johnston
Stephen Frost wrote * Alfred Perlstein ( alfred@ ) wrote: On 4/21/14, 12:47 PM, Stephen Frost wrote: Asking for help to address the FreeBSD performance would have been much better received. Thanks, Stephen That is exactly what I did, I asked for a version of postgresql that was easy

Re: [HACKERS] So why is EXPLAIN printing only *plan* time?

2014-04-27 Thread David G Johnston
Tom Lane-2 wrote Or we could add them into just the first planning-time printout, though that might also be misleading. If you are going to show a number for these steps, which seems like a good idea, then this seems like a reasonable option in the face of this situation. Basically two

Re: [HACKERS] need of anonymous record

2014-05-03 Thread David G Johnston
Peter Padua Krauss wrote The first question is about performance: *returns table* have the same performance than *returns record*?? If yes, the *record* datatype is somewhat outdated? Table defines the possibility to return a set while record can only ever return a single value; so likely the

Re: [HACKERS] EXPIRE as a statement

2014-05-04 Thread David G Johnston
Blagoj Petrushev wrote I know for example that redis has this feature, the EXPIRE / EXPIREAT / TTL commands. http://redis.io/commands/expire Redis seems to have decided that limiting the extent to which EXPIRE works is necessary in order to maintain performance; I'd be very worried about a

Re: [HACKERS] EXPIRE as a statement

2014-05-04 Thread David G Johnston
On Sun, May 4, 2014 at 10:06 PM, Tom Lane-2 [via PostgreSQL] ml-node+s1045698n5802390...@n5.nabble.com wrote: David G Johnston [hidden email]http://user/SendEmail.jtp?type=nodenode=5802390i=0 writes: Blagoj Petrushev wrote I know for example that redis has this feature, the EXPIRE

Re: [HACKERS] Supporting multiple column assignment in UPDATE (9.5 project)

2014-05-05 Thread David G Johnston
Merlin Moncure-2 wrote On Sat, May 3, 2014 at 5:48 AM, Marko Tiikkaja lt; marko@ gt; wrote: On 5/2/14, 10:10 PM, Merlin Moncure wrote: On Fri, May 2, 2014 at 3:03 PM, Tom Lane lt; tgl@.pa gt; wrote: Meh. Then you could have a query that works fine until you add a column to the

Re: [HACKERS] PGDLLEXPORTing all GUCs?

2014-05-07 Thread David G Johnston
Tom Lane-2 wrote Andres Freund lt; andres@ gt; writes: On 2014-05-07 09:35:06 -0400, Tom Lane wrote: Craig Ringer lt; craig@ gt; writes: Is there any reason _not_ to PGDLLEXPORT all GUCs, other than cosmetic concerns? That seems morally equivalent to is there a reason not to make

Re: [HACKERS] PQputCopyEnd doesn't adhere to its API contract

2014-05-08 Thread David G Johnston
Tom Lane-2 wrote Robert Haas lt; robertmhaas@ gt; writes: On Thu, May 8, 2014 at 1:51 PM, Tom Lane lt; tgl@.pa gt; wrote: Robert Haas lt; robertmhaas@ gt; writes: OK. It still seems to me that there's a doc fix needed here, if nothing else. The documentation for PQputCopyEnd()

Re: [HACKERS] [WIP] showing index maintenance on EXPLAIN

2014-05-08 Thread David G Johnston
Robert Haas wrote On Thu, May 8, 2014 at 2:31 AM, Jaime Casanova lt; jaime@ gt; wrote: On Wed, May 7, 2014 at 10:52 PM, Amit Kapila lt; amit.kapila16@ gt; wrote: On Thu, May 8, 2014 at 5:30 AM, Jaime Casanova lt; jaime@ gt; wrote: QUERY PLAN

Re: [HACKERS] Error in running DBT2

2014-05-13 Thread David G Johnston
Rohit Goyal wrote Hi Peter, On Tue, May 13, 2014 at 9:44 PM, Peter Geoghegan lt; pg@ gt; wrote: On Tue, May 13, 2014 at 12:36 PM, Rohit Goyal lt; rhtgyl.87@ gt; wrote: This pattern the above found many times. Please guide me through!!! IIRC, people have been working around

Re: [HACKERS] CTE that result in repeated sorting of the data

2014-05-15 Thread David G Johnston
Jon Nelson-14 wrote I was watching a very large recursive CTE get built today and this CTE involves on the order of a dozen or so loops joining the initial table against existing tables. It struck me that - every time through the loop the tables were sorted and then joined and that it would be

Re: [HACKERS] Error in running DBT2

2014-05-15 Thread David G Johnston
Andrew Dunstan wrote On 05/15/2014 06:37 PM, Rohit Goyal wrote: Hi All, I am using centOS6 and after all confugration, I run the below command *dbt2-run-workload -a pgsql -d 120 -w 1 -o /tmp/result -c 10 * *Error:* Stage 3. Processing of results... Killing client... waiting for server

Re: [HACKERS] 9.4 release notes

2014-05-15 Thread David G Johnston
Andres Freund-3 wrote On 2014-05-04 08:46:07 -0400, Bruce Momjian wrote: I have completed the initial version of the 9.4 release notes. You can view them here: http://www.postgresql.org/docs/devel/static/release-9-4.html I will be adding additional markup in the next few days.

Re: [HACKERS] Trigger concurrent execution

2014-05-15 Thread David G Johnston
Blagoj Petrushev wrote Hi, I'm thinking of an extension to trigger functionality like this: CREATE TRIGGER trigger_name AFTER event ON table CONCURRENTLY EXECUTE PROCEDURE trigger_fc This would call the trigger after the end of the transaction. The following is a

[HACKERS] Re: pg_basebackup: could not get transaction log end position from server: FATAL: could not open file ./pg_hba.conf~: Permission denied

2014-05-16 Thread David G Johnston
Andres Freund-3 wrote On 2014-05-16 18:29:25 +0200, Magnus Hagander wrote: On Fri, May 16, 2014 at 6:25 PM, Andres Freund lt; andres@ gt;wrote: On 2014-05-16 18:20:35 +0200, Magnus Hagander wrote: On Fri, May 16, 2014 at 5:46 PM, Joshua D. Drake lt; jd@ gt; wrote: At a

Re: [HACKERS] chr() is still too loose about UTF8 code points

2014-05-16 Thread David G Johnston
Tom Lane-2 wrote Noah Misch lt; noah@ gt; writes: On Fri, May 16, 2014 at 11:05:08AM -0400, Tom Lane wrote: I think this probably means we need to change chr() to reject code points above 10. Should we back-patch that, or just do it in HEAD? The compatibility risks resemble those

[HACKERS] Re: pg_upgrade fails: Mismatch of relation OID in database 8.4 - 9.3

2014-05-23 Thread David G Johnston
Bruce Momjian wrote On Thu, May 22, 2014 at 09:20:38AM -0600, Jeff Ross wrote: I just tested ALTER TABLE in 8.4 and it does create a toast table for this case in 9.4: CREATE TABLE test (x CHAR(10)); ALTER TABLE test ALTER COLUMN x TYPE CHAR(8000); I just tried this on the problem

Re: [HACKERS] PG Manual: Clarifying the repeatable read isolation example

2014-05-27 Thread David G Johnston
Heikki Linnakangas-6 wrote On 05/27/2014 10:12 PM, Evan Jones wrote: I was reading the Postgres MVCC documentation today (which is generally fantastic BTW), and am slightly confused by a single sentence example, describing possible read-only snapshot isolation anomalies. I would like to

Re: [HACKERS] Re-create dependent views on ALTER TABLE ALTER COLUMN ... TYPE?

2014-05-27 Thread David G Johnston
Alexander Shulgin wrote Hi Hackers, This came up recently on general list (and I've just hit the same issue today): http://www.postgresql.org/message-id/ CAB7nPqTLmMn1LTb5WE0v0dO57iP0U73yKwzbZytAXDF1CAWLZg@.gmail Why couldn't postgres re-create the dependent views automatically? I

Re: [HACKERS] Re-create dependent views on ALTER TABLE ALTER COLUMN ... TYPE?

2014-06-03 Thread David G Johnston
On Tuesday, June 3, 2014, Robert Haas [via PostgreSQL] ml-node+s1045698n5805857...@n5.nabble.com wrote: On Mon, Jun 2, 2014 at 10:00 PM, Tom Lane [hidden email] http://user/SendEmail.jtp?type=nodenode=5805857i=0 wrote: I can see two answers. Answer #1 is that the column type of bar.a

Re: [HACKERS] idle_in_transaction_timeout

2014-06-03 Thread David G Johnston
Vik Fearing wrote On 06/03/2014 03:30 PM, Abhijit Menon-Sen wrote: At 2014-06-03 15:06:11 +0200, vik.fearing@ wrote: This patch implements a timeout for broken clients that idle in transaction. I think this is a nice feature, but I suggest that (at the very least) the GUC should be

Re: [HACKERS] idle_in_transaction_timeout

2014-06-03 Thread David G Johnston
On Tue, Jun 3, 2014 at 7:40 PM, Josh Berkus [via PostgreSQL] ml-node+s1045698n5805933...@n5.nabble.com wrote: On 06/03/2014 02:53 PM, Tom Lane wrote: Josh Berkus [hidden email] http://user/SendEmail.jtp?type=nodenode=5805933i=0 writes: Out of curiosity, how much harder would it have been

Re: [HACKERS] Sigh, we need an initdb

2014-06-04 Thread David G Johnston
Robert Haas wrote On Wed, Jun 4, 2014 at 2:52 PM, Tom Lane lt; tgl@.pa gt; wrote: I just noticed that we had not one, but two commits in 9.4 that added fields to pg_control. And neither one changed PG_CONTROL_VERSION. This is inexcusable sloppiness on the part of the committers involved,

Re: [HACKERS] Sigh, we need an initdb

2014-06-04 Thread David G Johnston
Stefan Kaltenbrunner wrote On 06/04/2014 08:56 PM, Joshua D. Drake wrote: On 06/04/2014 11:52 AM, Tom Lane wrote: I think we could possibly ship 9.4 without fixing this, but it would be imprudent. Anyone think differently? Of course, if we do fix this then the door opens for pushing

Re: [HACKERS] configure does not check for bison or flex

2014-06-08 Thread David G Johnston
Eric L wrote I am installing postgresql from source on 64 bit Ubuntu 14.04 and when I run the ./configure script, it is successful, but when I run make it fails with an error: ERROR: `flex' is missing on your system. It is needed to create the file `bootscanner.c'. You can either get flex

Re: [HACKERS] RETURNING PRIMARY KEY syntax extension

2014-06-08 Thread David G Johnston
Ian Barwick wrote Hi, The JDBC API provides the getGeneratedKeys() method as a way of retrieving primary key values without the need to explicitly specify the primary key column(s). This is a widely-used feature, however the implementation has significant performance drawbacks.

Re: [HACKERS] RETURNING PRIMARY KEY syntax extension

2014-06-09 Thread David G Johnston
David G Johnston wrote Ian Barwick wrote Hi, The JDBC API provides the getGeneratedKeys() method as a way of retrieving primary key values without the need to explicitly specify the primary key column(s). This is a widely-used feature, however the implementation has significant

Re: [HACKERS] /proc/self/oom_adj is deprecated in newer Linux kernels

2014-06-10 Thread David G Johnston
In short: I can accept the idea that picking reasonable specific values is impossible so let's just ensure that children are always killed before the parent (basically the default behavior). If you then say that any system that is capable of implementing that rule should have it set then leaving

Re: [HACKERS] /proc/self/oom_adj is deprecated in newer Linux kernels

2014-06-10 Thread David G Johnston
Gurjeet Singh-4 wrote Even if the clueless DBA tries to set the oom_score_adj below that of Postmaster, Linux kernel prevents that from being done. I demonstrate that in the below screen share. I used GUC as well as plain command line to try and set a child's badness (oom_score_adj) to be

Re: [HACKERS] PL/pgSQL support to define multi variables once

2014-06-13 Thread David G Johnston
Tom Lane-2 wrote Andres Freund lt; andres@ gt; writes: On 2014-06-13 16:12:36 +0200, Pavel Stehule wrote: Quan' example is 100% valid in SQL/PSM and what I read about ADA then in ADA too. So what? plpgsql is neither language and this doesn't seem to be the way to make them actually

Re: [HACKERS] Audit of logout

2014-06-13 Thread David G Johnston
Tom Lane-2 wrote Another answer is to make both variables PGC_SIGHUP, on the grounds that it doesn't make much sense for them not to be applied system-wide; except that I think there was some idea that logging might be enabled per-user or per-database using ALTER ROLE/DATABASE. From a

Re: [HACKERS] comparison operators

2014-06-18 Thread David G Johnston
Andrew Dunstan wrote On 06/17/2014 07:25 PM, Andres Freund wrote: On 2014-06-17 19:22:07 -0400, Tom Lane wrote: Andrew Dunstan lt; andrew@ gt; writes: I went to have a look at documenting the jsonb comparison operators, and found that the docs on comparison operators contain this:

Re: [HACKERS] idle_in_transaction_timeout

2014-06-18 Thread David G Johnston
On Wed, Jun 18, 2014 at 8:01 PM, Josh Berkus [via PostgreSQL] ml-node+s1045698n5807868...@n5.nabble.com wrote: On 06/18/2014 04:54 PM, Marko Tiikkaja wrote: On 2014-06-19 1:46 AM, Josh Berkus wrote: Robert's right, not killing the BEGIN; only transactions is liable to result in user

Re: [HACKERS] idle_in_transaction_timeout

2014-06-19 Thread David G Johnston
On Thu, Jun 19, 2014 at 12:40 PM, Abhijit Menon-Sen-2 [via PostgreSQL] ml-node+s1045698n5808016...@n5.nabble.com wrote: At 2014-06-19 17:53:17 +0200, [hidden email] http://user/SendEmail.jtp?type=nodenode=5808016i=0 wrote: I much prefer with in but it doesn't much matter. If you look at

Re: [HACKERS] idle_in_transaction_timeout

2014-06-22 Thread David G Johnston
On Sunday, June 22, 2014, Kevin Grittner-5 [via PostgreSQL] ml-node+s1045698n580830...@n5.nabble.com wrote: Andres Freund [hidden email] http://user/SendEmail.jtp?type=nodenode=5808309i=0 wrote: I think we'll want a version of this that just fails the transaction once we have the

Re: [HACKERS] idle_in_transaction_timeout

2014-06-23 Thread David G Johnston
I think that'd be rather confusing. For one it'd need to be idle_in_transaction_timeout Why? We're cancelling an idle transaction, not an idle in transaction, whatever that is. ​The confusion derives from the fact we are affecting a session whose state is idle in transaction, not one

Re: [HACKERS] idle_in_transaction_timeout

2014-06-23 Thread David G Johnston
A long idle in transaction state pretty much always indicates a problematic interaction with postgres. True. Which makes me wonder whether we shouldn't default this to something non-zero -- even if it is 5 or 10 days. ​I guess it depends on how parental we want to be. But if we go that

Re: [HACKERS] idle_in_transaction_timeout

2014-06-24 Thread David G Johnston
On Tue, Jun 24, 2014 at 9:20 AM, Vik Fearing [via PostgreSQL] ml-node+s1045698n5808882...@n5.nabble.com wrote: On 06/22/2014 05:11 PM, Kevin Grittner wrote: I found one substantive issue that had been missed in discussion, though. The patch modifies the postgres_fdw extension to make it

Re: [HACKERS] idle_in_transaction_timeout

2014-06-24 Thread David G Johnston
On Tue, Jun 24, 2014 at 10:05 AM, Robert Haas [via PostgreSQL] ml-node+s1045698n580889...@n5.nabble.com wrote: On Tue, Jun 24, 2014 at 9:18 AM, Vik Fearing [hidden email] http://user/SendEmail.jtp?type=nodenode=5808893i=0 wrote: On 06/22/2014 05:11 PM, Kevin Grittner wrote: I found one

Re: [HACKERS] idle_in_transaction_timeout

2014-06-24 Thread David G Johnston
On Tue, Jun 24, 2014 at 11:11 AM, Robert Haas [via PostgreSQL] ml-node+s1045698n5808915...@n5.nabble.com wrote: On Tue, Jun 24, 2014 at 10:50 AM, Vik Fearing [hidden email] http://user/SendEmail.jtp?type=nodenode=5808915i=0 wrote: On 06/24/2014 04:04 PM, Robert Haas wrote: If the local

[HACKERS] Re: how can i prevent materialized views from refreshing during pg_restore

2014-06-26 Thread David G Johnston
bithead wrote I asked a question over on StackOverflow, and Craig Ringer told me to report it here. http://stackoverflow.com/questions/24413161/how-can-i-prevent-materialized-views-from-refreshing-during-pg-restore I have created a dump of the database using pg_dump in custom format

Re: [HACKERS] Can simplify 'limit 1' with slow function?

2014-07-01 Thread David G Johnston
Merlin Moncure-2 wrote On Tue, Jul 1, 2014 at 2:16 PM, Martijn van Oosterhout lt; kleptog@ gt; wrote: On Sun, Jun 29, 2014 at 10:05:50PM +0800, gotoschool6g wrote: The simplified scene: select slowfunction(s) from a order by b limit 1; is slow than select slowfunction(s) from (select s

Re: [HACKERS] Can simplify 'limit 1' with slow function?

2014-07-02 Thread David G Johnston
Martijn van Oosterhout wrote On Tue, Jul 01, 2014 at 02:36:55PM -0500, Merlin Moncure wrote: On Tue, Jul 1, 2014 at 2:16 PM, Martijn van Oosterhout lt; kleptog@ gt; wrote: On Sun, Jun 29, 2014 at 10:05:50PM +0800, gotoschool6g wrote: The simplified scene: select slowfunction(s) from a

[HACKERS] Re: how to find the order of joins from Explain command XML plan output in PostgreSQL

2014-07-09 Thread David G Johnston
csrajmohan wrote EXPLAIN (format XML) command in PostgreSQL9.3.4 gives the plan chosen by the optimizer in XML format. In my program, I have to extract certain data about optimizer plan from this XML output. I am using *LibXML2* library for parsing the XML. I had successfully extracted

Re: [HACKERS] Is there a way to temporarily disable a index

2014-07-11 Thread David G Johnston
Benedikt Grundmann wrote That is it possible to tell the planner that index is off limits i.e. don't ever generate a plan using it? Rationale: Schema changes on big tables. I might have convinced myself / strong beliefs that for all queries that I need to be fast the planner does not

Re: [HACKERS] Making joins involving ctid work for the benefit of UPSERT

2014-07-23 Thread David G Johnston
Peter Geoghegan-3 wrote with semantics like this: 1. Search the table, using any type of scan you like, for a row matching the given predicate. Perhaps I've misunderstood, but this is fundamentally different to what I'd always thought would need to happen. I always understood that the

[HACKERS] Re: Proposed changing the definition of decade for date_trunc and extract

2014-08-01 Thread David G Johnston
Mike Swanson wrote For a long time (since version 8.0), PostgreSQL has adopted the logical barriers for centuries and millenniums in these functions. The calendar starts millennium and century 1 on year 1, directly after 1 BC. Unfortunately decades are still reported rather simplistically by

Re: [HACKERS] Append to a GUC parameter ?

2014-08-05 Thread David G Johnston
Alvaro Herrera-9 wrote Bruce Momjian wrote: On Tue, Aug 5, 2014 at 12:52:51PM -0700, Josh Berkus wrote: On 08/05/2014 11:12 AM, Jerry Sievers wrote: shared_preload_libraries += auto_explain Would do the trick. I've never heard this mentioned before so presume not many have

Re: [HACKERS] select_common_type()'s behavior doesn't match the documentation

2014-08-06 Thread David G Johnston
Tom Lane-2 wrote In our fine manual, at http://www.postgresql.org/docs/devel/static/typeconv-union-case.html it's claimed that the nontrivial parts of UNION type resolution work like this: 4. Choose the first non-unknown input type which is a preferred type in that category, if there

Re: [HACKERS] Fixed redundant i18n strings in json

2014-08-07 Thread David G Johnston
Tom Lane-2 wrote Robert Haas lt; robertmhaas@ gt; writes: On Sat, Aug 2, 2014 at 9:15 AM, Daniele Varrazzo lt; daniele.varrazzo@ gt; wrote: I'd definitely replace /arg/argument/. Furthermore I'd avoid the form argument 1: something is wrong: the string is likely to end up in

Re: [HACKERS] jsonb format is pessimal for toast compression

2014-08-08 Thread David G Johnston
akapila wrote On Sat, Aug 9, 2014 at 6:15 AM, Tom Lane lt; tgl@.pa gt; wrote: Stephen Frost lt; sfrost@ gt; writes: What about considering how large the object is when we are analyzing if it compresses well overall? Hmm, yeah, that's a possibility: we could redefine the limit at

Re: [HACKERS] 9.4 pg_restore --help changes

2014-08-08 Thread David G Johnston
Peter Eisentraut-2 wrote 9.3 pg_restore --help output: -I, --index=NAME restore named index -n, --schema=NAMErestore only objects in this schema -P, --function=NAME(args)restore named function -t, --table=NAME restore named table(s) -T,

Re: [HACKERS] Hardening pg_upgrade

2014-08-21 Thread David G Johnston
Bruce Momjian wrote I had to make an exception for temporary tables because pg_upgrade uses temporary tables to collect schema information. I tried writing the query to use CTEs (second patch), but I would then have to have one query for 8.3, which doesn't support CTEs, and another for 8.4+,

Re: [HACKERS] proposal: rounding up time value less than its unit.

2014-08-21 Thread David G Johnston
Peter Eisentraut-2 wrote On 8/21/14 11:16 AM, Tom Lane wrote: Heikki Linnakangas lt; hlinnakangas@ gt; writes: The patch also rounds a zero up to one. A naked zero with no unit is not affected, but e.g if you have log_rotation_age=0s, it will not disable the feature as you might expect,

Re: [HACKERS] proposal: rounding up time value less than its unit.

2014-08-23 Thread David G Johnston
Tom Lane-2 wrote Tomonari Katsumata lt; t.katsumata1122@ gt; writes: This patch rounds up the value when only it's less than required unit. .. Although my original complaint is fixed, I'm worried about this change will make users confusing. Indeed. I have not understood why you are

Re: [HACKERS] proposal: rounding up time value less than its unit.

2014-08-23 Thread David G Johnston
Tom Lane-2 wrote David G Johnston lt; david.g.johnston@ gt; writes: Tom Lane-2 wrote Indeed. I have not understood why you are insisting on round up semantics. Wouldn't it make more sense for the behavior to be round to nearest? That would get rid of any worries about treating zero

Re: [HACKERS] proposal: rounding up time value less than its unit.

2014-08-26 Thread David G Johnston
Tom Lane-2 wrote Robert Haas lt; robertmhaas@ gt; writes: I liked David Johnston's even stronger suggestion upthread: make it an error to specify a value requires rounding of any kind. In other words, if the minimum granularity is 1 minute, you can specify that as 60 seconds instead, but

Re: [HACKERS] Code bug or doc bug?

2014-08-27 Thread David G Johnston
Bruce Momjian wrote On Wed, Aug 27, 2014 at 09:05:41AM -0400, Robert Haas wrote: Another idea is to have a command that you can run, while connected to a particular database, that updates the default tablespace for that database without actually moving any data on disk - i.e. it sets

[HACKERS] Re: Why data of timestamptz does not store value of timezone passed to it?

2014-08-28 Thread David G Johnston
rohtodeveloper wrote I have a question about data type timestamp with time zone. Why data of timestamptz does not store value of timezone passed to it? The timezone of output(+08) is different with the original input value(+02). It seems not to be good behavior. Its good for the inumerable

[HACKERS] Re: Why data of timestamptz does not store value of timezone passed to it?

2014-08-29 Thread David G Johnston
On Fri, Aug 29, 2014 at 11:12 AM, Greg Stark [via PostgreSQL] ml-node+s1045698n5816903...@n5.nabble.com wrote: On Fri, Aug 29, 2014 at 4:03 PM, Kevin Grittner [hidden email] http://user/SendEmail.jtp?type=nodenode=5816903i=0 wrote: It was actually rather disappointing to hear that we had a

Re: [HACKERS] Inverse of pg_get_serial_sequence?

2014-08-29 Thread David G Johnston
Andres Freund-3 wrote Hi, We have pg_get_serial_sequence() mapping (relation, colum) to the sequence. What I'm missing right now is the inverse. I.e. given a sequence tell me the owner. describe.c has a query for that, and it's not too hard to write, but it still seems 'unfriendly' not to

Re: [HACKERS] Inverse of pg_get_serial_sequence?

2014-08-29 Thread David G Johnston
Andres Freund-3 wrote On 2014-08-29 17:55:38 -0700, David G Johnston wrote: Andres Freund-3 wrote pg_get_sequence_ownedby(...) My problem is that that possibly be confused with the user owning the sequence :/ Though as soon as that person reads the output their misunderstanding would

[HACKERS] Re: [BUGS] Re: BUG #9555: pg_dump for tables with inheritance recreates the table with the wrong order of columns

2014-08-31 Thread David G Johnston
Tom Lane-2 wrote Bruce Momjian lt; bruce@ gt; writes: I have developed the attached patch to warn about column reordering in this odd case. The patch mentions the reordering of c: NOTICE: merging column a with inherited definition NOTICE: merging column c with inherited

Re: [HACKERS] Built-in binning functions

2014-08-31 Thread David G Johnston
Simon Riggs wrote width_bucket() seems to refer to an equal-width binning process. The function being discussed here is a generic mechanism, the boundaries of which could have been decided using equal-frequency or other mechanisms. Using the word width in those contexts could be confusing.

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread David G Johnston
Joel Jacobson-2 wrote On Mon, Sep 1, 2014 at 4:26 PM, Craig Ringer lt; craig@ gt; wrote: Well, the idiom: EXECUTE format(SELECT %I FROM %I WHERE $1, col, tbl) USING val; is not lovely. It works, but it's clumsy. This is exactly why we need a new language. All the clumsy stuff we

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread David G Johnston
Álvaro Hernández Tortosa wrote On 01/09/14 21:52, Joel Jacobson wrote: On Mon, Sep 1, 2014 at 8:34 PM, Álvaro Hernández Tortosa lt; aht@ gt; wrote: What I can add is that, if Postgres is to devote resources to a new language, I would plan it with a broader scope. What would attract

Re: [HACKERS] PL/pgSQL 2

2014-09-01 Thread David G Johnston
On Mon, Sep 1, 2014 at 9:07 PM, Andrew Dunstan [via PostgreSQL] ml-node+s1045698n5817265...@n5.nabble.com wrote: On 09/01/2014 08:09 PM, Neil Tiffin wrote: That should be enough alone to suggest postgreSQL start working on a modern, in core, fast, fully supported language. Of course

Re: [HACKERS] PL/pgSQL 2

2014-09-03 Thread David G Johnston
This is more of an SQL request the pl/pgsql but is/has there been thought to adding the ternary if/then opeator? Something like: boolean_exp ? val_if_true : val_if_false using ? by itself would be OK but not ideal - and the addition of the doesn't seem hateful... Sorry if this is deemed

Re: [HACKERS] Pg_upgrade and toast tables bug discovered

2014-09-03 Thread David G Johnston
Based upon the dates the noted patch is not in 9.3.5; which was released a couple of weeks previous to it being committed. David J. nyetter wrote I'm not sure it's fixed. I am attempting a pg_upgrade from 9.2.8 to 9.3.5 and it dies like so: (...many relations restoring successfully

Re: [HACKERS] PQputCopyEnd doesn't adhere to its API contract

2014-09-04 Thread David G Johnston
On Wed, Sep 3, 2014 at 6:25 PM, Bruce Momjian [via PostgreSQL] ml-node+s1045698n5817646...@n5.nabble.com wrote: On Fri, May 9, 2014 at 12:03:36PM -0400, Robert Haas wrote: On Thu, May 8, 2014 at 5:21 PM, Tom Lane [hidden email] http://user/SendEmail.jtp?type=nodenode=5817646i=0 wrote:

Re: [HACKERS] PQputCopyEnd doesn't adhere to its API contract

2014-09-04 Thread David G Johnston
out which other functions in the documentation need similar updates. OK, did David G Johnston email comments from today help here? I didn't look at them in detail, but they don't seem to match the style of our documentation generally. ​Specific observations would help though

Re: [HACKERS] Pg_upgrade and toast tables bug discovered

2014-09-04 Thread David G Johnston
On Thu, Sep 4, 2014 at 2:39 PM, Bruce Momjian [via PostgreSQL] ml-node+s1045698n5817828...@n5.nabble.com wrote: On Thu, Sep 4, 2014 at 11:37:27AM -0600, Noah Yetter wrote: The 9.3.5 release notes contain... • Fix pg_upgrade for cases where the new server creates a TOAST table but

[HACKERS] Re: [PATCH] parser: optionally warn about missing AS for column and table aliases

2014-09-05 Thread David G Johnston
Marko Tiikkaja-4 wrote On 2014-09-05 22:38, Oskari Saarenmaa wrote: I wrote the attached patch to optionally emit warnings when column or table aliases are used without the AS keyword after errors caused by typos in statements turning unintended things into aliases came up twice this week.

[HACKERS] Re: [PATCH] parser: optionally warn about missing AS for column and table aliases

2014-09-05 Thread David G Johnston
David G Johnston wrote Marko Tiikkaja-4 wrote On 2014-09-05 22:38, Oskari Saarenmaa wrote: I wrote the attached patch to optionally emit warnings when column or table aliases are used without the AS keyword after errors caused by typos in statements turning unintended things into aliases

Re: [HACKERS] PL/pgSQL 2

2014-09-06 Thread David G Johnston
On Sat, Sep 6, 2014 at 12:38 PM, Jan Wieck-3 [via PostgreSQL] ml-node+s1045698n5818047...@n5.nabble.com wrote: On 09/06/2014 12:33 PM, Marko Tiikkaja wrote: On 2014-09-06 6:31 PM, Jan Wieck wrote: On 09/06/2014 12:17 PM, Marko Tiikkaja wrote: OK, fine. But that's not what I suggested on

Re: [HACKERS] PQputCopyEnd doesn't adhere to its API contract

2014-09-08 Thread David G Johnston
On Mon, Sep 8, 2014 at 11:45 AM, Robert Haas [via PostgreSQL] ml-node+s1045698n5818200...@n5.nabble.com wrote: On Thu, Sep 4, 2014 at 6:38 PM, David Johnston [hidden email] http://user/SendEmail.jtp?type=nodenode=5818200i=0 wrote: One of the trade-offs I mentioned...its more style than

Re: [HACKERS] PQputCopyEnd doesn't adhere to its API contract

2014-09-08 Thread David G Johnston
On Mon, Sep 8, 2014 at 6:19 PM, David Johnston david.g.johns...@gmail.com wrote: On Mon, Sep 8, 2014 at 11:45 AM, Robert Haas [via PostgreSQL] ml-node+s1045698n5818200...@n5.nabble.com wrote: On Thu, Sep 4, 2014 at 6:38 PM, David Johnston [hidden email]

Re: [HACKERS] documentation update for doc/src/sgml/func.sgml

2014-09-13 Thread David G Johnston
Fabien COELHO-3 wrote Of course a general rule how to link to WP would be nice ... I'm afraid that the current implicit rule is more or less no links, at least there are very few of them but in the glossary, and when I submitted docs with them they were removed before committing. Ideally

Re: [HACKERS] Postgres code for a query intermediate dataset

2014-09-13 Thread David G Johnston
Atri Sharma wrote On Sat, Sep 13, 2014 at 11:06 PM, Rohit Goyal lt; rhtgyl.87@ gt; wrote: Hi All, I want to work on the code of intermediate dataset of select and update query. For example. Rohit's salary has been updated 4 times, so it has 4 different version of salary. I want

Re: [HACKERS] RLS feature has been committed

2014-09-22 Thread David G Johnston
Robert Haas wrote It's difficult to imagine a more flagrant violation of process than committing a patch without any warning and without even *commenting* on the fact that clear objections to commit were made on a public mailing list. If that is allowed to stand, what can we assume other

Re: [HACKERS] proposal: rounding up time value less than its unit.

2014-09-22 Thread David G Johnston
Tom Lane-2 wrote The case where this argument falls down is for special values, such as where zero means something quite different from the smallest nonzero value. Peter suggested upthread that we should redefine any GUC values for which that is true, but (a) I think that loses on backwards

Re: [HACKERS] proposal: rounding up time value less than its unit.

2014-09-26 Thread David G Johnston
On Fri, Sep 26, 2014 at 2:39 PM, Stephen Frost [via PostgreSQL] ml-node+s1045698n5820714...@n5.nabble.com wrote: David, * David Johnston ([hidden email] http://user/SendEmail.jtp?type=nodenode=5820714i=0) wrote: ​This is 9.5 material because 1) it isn't all that critical and, 2) we DO

Re: [HACKERS] Log notice that checkpoint is to be written on shutdown

2014-10-02 Thread David G Johnston
Michael Banck-2 wrote Hi, we have seen repeatedly that users can be confused about why PostgreSQL is not shutting down even though they requested it. Usually, this is because `log_checkpoints' is not enabled and the final checkpoint is being written, delaying shutdown. As no message

Re: [HACKERS] proposal: doc: simplify examples of dynamic SQL

2014-10-02 Thread David G Johnston
Jim Nasby-5 wrote On 10/2/14, 6:51 AM, Pavel Stehule wrote: EXECUTE format('UPDATE tbl SET %I = newvalue WHERE key = %L', colname, keyvalue) or -1, because of quoting issues EXECUTE format('UPDATE tbl SET %I = newvalue WHERE key = $1', colname)

Re: [HACKERS] Trailing comma support in SELECT statements

2014-10-03 Thread David G Johnston
Andrew Dunstan wrote On 10/03/2014 12:20 PM, Bruce Momjian wrote: On Sun, Sep 28, 2014 at 01:42:46PM +0200, Bogdan Pilch wrote: Hi, I have created a small patch to postgres source (in particular the psql part of it) that accepts trailing comma at the end of list in SELECT statement. The

Re: [HACKERS] Trailing comma support in SELECT statements

2014-10-16 Thread David G Johnston
Jim Nasby-5 wrote On 10/3/14, 4:02 PM, David G Johnston wrote: Should we also allow: SELECT , col1 , col2 , col3 FROM ... ? I would say yes, if we're going to do this. I don't see it being any worse than trailing commas. If we are going to do this, we need to do it EVERYWHERE

Re: [HACKERS] Superuser connect during smart shutdown

2014-10-16 Thread David G Johnston
Tom Lane-2 wrote Jim Nasby lt; Jim.Nasby@ gt; writes: Something else mentioned was that once you start a smart shutdown you have no good way (other than limited ps output) to see what the shutdown is waiting on. I'd like to have some way to get back into the database to see what's going

Re: [HACKERS] CREATE POLICY and RETURNING

2014-10-17 Thread David G Johnston
Robert Haas wrote That's an argument in favour of only applying a read-filtering policy where a RETURNING clause is present, but that introduces the surprise! the effects of your DELETE changed based on an unrelated clause! issue. No- if we were going to do this, I wouldn't want to change the

Re: [HACKERS] Materialized views don't show up in information_schema

2014-10-17 Thread David G Johnston
Nicolas Barbier wrote 2014-10-16 Stephen Frost lt; sfrost@ gt;: Alright, coming back to this, I have to ask- how are matviews different from views from the SQL standard's perspective? Matviews that are always up to date when you access them are semantically exactly the same as normal

Re: [HACKERS] Hash index creation warning

2014-10-17 Thread David G Johnston
Bruce Momjian wrote Now that we have the create hash index warning in 9.5, I realized that we don't warn about hash indexes with PITR, only crash recovery and streaming. This patch fixes that. Is the wording cannot be used too vague. The CREATE INDEX manual page has the words give wrong

Re: [HACKERS] Would you help to review our modifications

2014-10-20 Thread David G Johnston
rohtodeveloper wrote So how to deal with this kind of situation if I want a implicit conversion? As of the out-of-support 8.3 release many of the implicit casts previously defined have been changed to explicit casts. It is a catalog change - obviously, since you can still define implicit casts

[HACKERS] Re: Add regression tests for autocommit-off mode for psql and fix some omissions

2014-10-20 Thread David G Johnston
Jim Nasby-5 wrote On 10/7/14, 2:11 AM, Feike Steenbergen wrote: On 7 October 2014 01:41, Jim Nasbylt; Jim.Nasby@ gt; wrote: The options I see... 1) If there's a definitive way to tell from backend source code what commands disallow transactions then we can just use that information to

Re: [HACKERS] Questions on domain on composite / casts ignoring domains

2014-10-20 Thread David G Johnston
Jim Nasby-5 wrote I'm trying to create what amounts to a new type. This would be rather easy if I could perform a CHECK on a composite type, which I could do if I could create a domain on top of a composite. Is there any reason in particular that hasn't been done? As an alternative, I tried

Re: [HACKERS] idea: allow AS label inside ROW constructor

2014-10-23 Thread David G Johnston
Andrew Dunstan wrote On 10/23/2014 09:57 AM, Florian Pflug wrote: On Oct23, 2014, at 15:39 , Andrew Dunstan lt; andrew@ gt; wrote: On 10/23/2014 09:27 AM, Merlin Moncure wrote: On Thu, Oct 23, 2014 at 4:34 AM, Pavel Stehule lt; pavel.stehule@ gt; wrote: postgres=# select

  1   2   3   4   5   6   7   >