Re: Where to store Blobs?

2019-04-19 Thread Jamesie Pic
Storing files in the database has already been demonstrated as not an efficient trade-off [0]. As such, this post provides a subjective story about files in the database, rather than an objective compare. So, I have this ridiculous situation where dumping a database with 12k user-submitted forms w

Re: PostgreSQL ping/pong to client

2019-04-19 Thread Peter J. Holzer
On 2019-04-17 18:41:57 +0200, Francisco Olarte wrote: > On Wed, Apr 17, 2019 at 4:49 PM Ajay Pratap > wrote: > > Correction: I meant when my java application dies postgres should break all > > the connections that were associated with that peer. > > And how is the server supposed to detect that

Primary key data type: integer vs identity

2019-04-19 Thread Rich Shepard
When I created the database I set primary key data types as integer; for example: Column| Type | Collation | Nullable | Default --+---+---+--+- org_id | integer | | not null | nextval('organizations_o

Re: Primary key data type: integer vs identity

2019-04-19 Thread Adrian Klaver
On 4/19/19 10:55 AM, Rich Shepard wrote: When I created the database I set primary key data types as integer; for example: Column    |   Type  | Collation | Nullable |  Default --+---+---+--+-  org_id   | integer | 

Re: Primary key data type: integer vs identity

2019-04-19 Thread Michel Pelletier
On Fri, Apr 19, 2019 at 10:55 AM Rich Shepard wrote: > When I created the database I set primary key data types as integer; for > example: > > Column| Type | Collation | Nullable | Default > --+---+---+--+- > org_id |

Re: Primary key data type: integer vs identity

2019-04-19 Thread Rich Shepard
On Fri, 19 Apr 2019, Michel Pelletier wrote: https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-SERIAL "The data types smallserial, serial and bigserial are not true types, but merely a notational convenience for creating unique identifier columns" so really there's no differ

Re: Primary key data type: integer vs identity

2019-04-19 Thread Rich Shepard
On Fri, 19 Apr 2019, Adrian Klaver wrote: If it is working for you now I see no reason to switch. Adrian, It does work. I just learned about the SQL identity type and want to learn when it's most appropriate to use. The databases I develop all work with integers as primary keys and reading ab

Re: Primary key data type: integer vs identity

2019-04-19 Thread Adrian Klaver
On 4/19/19 11:14 AM, Rich Shepard wrote: On Fri, 19 Apr 2019, Adrian Klaver wrote: If it is working for you now I see no reason to switch. Adrian, It does work. I just learned about the SQL identity type and want to learn when it's most appropriate to use. The databases I develop all work wi

Re: Primary key data type: integer vs identity

2019-04-19 Thread Ken Tanzer
On Fri, Apr 19, 2019 at 11:20 AM Adrian Klaver wrote: > On 4/19/19 11:14 AM, Rich Shepard wrote: > > On Fri, 19 Apr 2019, Adrian Klaver wrote: > > > >> If it is working for you now I see no reason to switch. > > > > Adrian, > > > > It does work. I just learned about the SQL identity type and want

Re: Primary key data type: integer vs identity

2019-04-19 Thread Rich Shepard
On Fri, 19 Apr 2019, Adrian Klaver wrote: Mainly for folks that want cross database SQL compliance. It is not a type so much as a way of specifying an auto-increment column. Thank you, Adrian. I saw that it was a column specification and your explanation of its application is really helpful.

Re: Primary key data type: integer vs identity

2019-04-19 Thread Adrian Klaver
On 4/19/19 11:32 AM, Ken Tanzer wrote: On Fri, Apr 19, 2019 at 11:20 AM Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote: On 4/19/19 11:14 AM, Rich Shepard wrote: > On Fri, 19 Apr 2019, Adrian Klaver wrote: > >> If it is working for you now I see no reason to switch.

Re: Primary key data type: integer vs identity

2019-04-19 Thread Adrian Klaver
On 4/19/19 11:32 AM, Ken Tanzer wrote: On Fri, Apr 19, 2019 at 11:20 AM Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote: On 4/19/19 11:14 AM, Rich Shepard wrote: > On Fri, 19 Apr 2019, Adrian Klaver wrote: > >> If it is working for you now I see no reason to switch.

Re: Primary key data type: integer vs identity

2019-04-19 Thread Ken Tanzer
On Fri, Apr 19, 2019 at 12:02 PM Adrian Klaver wrote: > On 4/19/19 11:32 AM, Ken Tanzer wrote: > > On Fri, Apr 19, 2019 at 11:20 AM Adrian Klaver > > mailto:adrian.kla...@aklaver.com>> wrote: > > > > On 4/19/19 11:14 AM, Rich Shepard wrote: > > > On Fri, 19 Apr 2019, Adrian Klaver wrote:

Re: Primary key data type: integer vs identity

2019-04-19 Thread Adrian Klaver
On 4/19/19 12:35 PM, Ken Tanzer wrote: Thanks Adrian.  You are as usual correct.  (I had a bunch of tables created by a function that I assumed were serial, but were not.) Identity columns still seem tidier and more manageable.  Can you tell if the function I referenced would change the own

Re: Primary key data type: integer vs identity

2019-04-19 Thread Ken Tanzer
On Fri, Apr 19, 2019 at 12:50 PM Adrian Klaver wrote: > On 4/19/19 12:35 PM, Ken Tanzer wrote: > > > > > Thanks Adrian. You are as usual correct. (I had a bunch of tables > > created by a function that I assumed were serial, but were not.) > > Identity columns still seem tidier and more managea

Re: Primary key data type: integer vs identity

2019-04-19 Thread Adrian Klaver
On 4/19/19 1:02 PM, Ken Tanzer wrote: On Fri, Apr 19, 2019 at 12:50 PM Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote: On 4/19/19 12:35 PM, Ken Tanzer wrote: > > Thanks Adrian.  You are as usual correct.  (I had a bunch of tables > created by a function that I assume

Re: Primary key data type: integer vs identity

2019-04-19 Thread Ken Tanzer
On Fri, Apr 19, 2019 at 1:39 PM Adrian Klaver wrote: > On 4/19/19 1:02 PM, Ken Tanzer wrote: > > On Fri, Apr 19, 2019 at 12:50 PM Adrian Klaver > > mailto:adrian.kla...@aklaver.com>> wrote: > > > > On 4/19/19 12:35 PM, Ken Tanzer wrote: > > > > > > > > Thanks Adrian. You are as usu

Re: Primary key data type: integer vs identity

2019-04-19 Thread Adrian Klaver
On 4/19/19 2:31 PM, Ken Tanzer wrote: On Fri, Apr 19, 2019 at 1:39 PM Adrian Klaver Thanks, though I don't see what this shows, since there were not separate users involved.  So I loaded up a copy of 11.2, and discovered Well the table was created by one user and the serial was changed to

Re: Where to store Blobs?

2019-04-19 Thread Jamesie Pic
I forgot to mention that my deployments include automated migrations as often as possible, sometimes destructive for refactoring purpose, as such, to maintain PostgreSQL on a basic linux box I am: - for having an automated backup prior in the automated deployment script that may play destructive m