Re: [GENERAL] B-tree index on a VARCHAR(4000) column

2017-09-10 Thread John Turner
On Sun, Sep 10, 2017 at 1:24 PM Tom Lane wrote: > > For every other purpose, PG just pays attention to the actual column > values' lengths. > > Thanks for elaborating, Tom. This would appear to be a(nother) case where PG represents the voice of sanity as compared with 'the other guys' : ) John

Re: [GENERAL] B-tree index on a VARCHAR(4000) column

2017-09-10 Thread John Turner
On Sun, Sep 10, 2017 at 10:42 AM Merlin Moncure wrote: > On Friday, September 8, 2017, John Turner wrote: > >> >> >> On Fri, Sep 8, 2017 at 6:57 AM Tom Lane wrote: >> >>> Ron Johnson writes: >>> > Based on LENGTH(offending_column), none

Re: [GENERAL] B-tree index on a VARCHAR(4000) column

2017-09-08 Thread John Turner
On Fri, Sep 8, 2017 at 6:57 AM Tom Lane wrote: > Ron Johnson writes: > > Based on LENGTH(offending_column), none of the values are more than 144 > > bytes in this 44.2M row table. Even though VARCHAR is, by definition, > > variable length, are there any internal design issues which would make >

Re: [GENERAL] Imperative Query Languages

2017-07-04 Thread John Turner
(copying the list) On Wed, Jul 5, 2017 at 12:22 AM, Jason Dusek wrote: > Are there any “semi-imperative” query languages that have been tried in > the past? > not particularly relevant to the Unix or Windows worlds, but on OpenVMS there's Datatrieve: https://en.wikipedia.org/wiki/DATATRIEVE -Jo

Re: [GENERAL] Unique values on multiple tables

2016-03-28 Thread John Turner
On Mon, Mar 28, 2016 at 2:32 AM, Sterpu Victor wrote: *table1* > id > nr - integer > > *table2* > id > id_table1 - FK in Table 1 > valid_from - timestamp > > There must be unique values for: > - nr - from table1 > and > - YEAR(MIN(valid_from)) from table 2 > Just trying to understand your goal

Re: [GENERAL] PostgreSQL Developer Best Practices

2015-08-26 Thread John Turner
On Tue, 25 Aug 2015 18:57:28 -0400, Neil Tiffin wrote: On Aug 25, 2015, at 1:38 PM, Karsten Hilbert wrote: In most cases developers don’t care about index, unique, foreign key, or primary key names (from a coding standpoint) Until the day they’d like to write a reliable database cha

Re: [GENERAL] PostgreSQL Developer Best Practices

2015-08-24 Thread John Turner
On Mon, 24 Aug 2015 12:40:37 -0400, Joshua D. Drake wrote: On 08/24/2015 09:34 AM, Melvin Davidson wrote: And again, I am talking about _database_ design, not Web apps. Letting Web developers design a database to work with their app, is a very, Very, VERY bad idea. And I don't argue that b

Re: [GENERAL] PostgreSQL Developer Best Practices

2015-08-24 Thread John Turner
On Mon, 24 Aug 2015 09:15:27 -0400, Ray Cote wrote: 9. Do NOT arbitrarily assign an "id" column to a table as a primary key when other columns are perfectly suited as a unique primary key. ... Good example: CREATE TABLE accounts ( accout_id bigint NOT NULL , I would

Re: [GENERAL] PostgreSQL - The Best Overall Database

2015-08-13 Thread John Turner
On Thu, 13 Aug 2015 09:46:49 -0400, Melvin Davidson wrote: On Thu, Aug 13, 2015 at 9:21 AM, John McKown wrote: On Thu, Aug 13, 2015 at 8:03 AM, Melvin Davidson wrote: This should put a smile on all PostgreSQL DBA's faces. The Best Overall Database ​Very nice. Of course, I have a "th

Re: [GENERAL] range type expression syntax

2015-02-27 Thread John Turner
l-ow...@postgresql.org [pgsql-general-ow...@postgresql.org]" im Auftrag von "John Turner [jjtur...@energi.com] Gesendet: Donnerstag, 26. Februar 2015 21:17 An: pgsql-general@postgresql.org Betreff: Re: [GENERAL] range type expression syntax On Thu, 26 Feb 2015 15:11:28 -0500, Jo

Re: [GENERAL] range type expression syntax

2015-02-26 Thread John Turner
On Thu, 26 Feb 2015 15:11:28 -0500, John Turner wrote: Seems I'm missing a trick trying to get rangetypes working: No problem building the string: select concat('''[', now()::date, ',', now()::date, ']''') testrange; testrang

[GENERAL] range type expression syntax

2015-02-26 Thread John Turner
Seems I'm missing a trick trying to get rangetypes working: No problem building the string: select concat('''[', now()::date, ',', now()::date, ']''') testrange; testrange --- '[2015-02-26,2015-02-26]' (1 row) Bombed-out trying to turn this into a daterange: po