Re: [GENERAL] What's the benefit (or usage scenario) of a "typed table"?

2016-12-31 Thread Adrian Klaver
On 12/31/2016 08:25 AM, Thomas Kellerer wrote: David G. Johnston schrieb am 31.12.2016 um 16:51: I wonder what the benefit of a typed table is and when this would be useful? But I'd say if you want a table with said structure you should plan on droppign the original type after you've altered

Re: [GENERAL] What's the benefit (or usage scenario) of a "typed table"?

2016-12-31 Thread Tom Lane
Thomas Kellerer writes: > I recently stumbled over "typed tables" in Postgres > (there were several questions containing this on stackoverflow recently) > create type some_type as (id integer, data text); > create table some_table of some_type; > I wonder what the benefit of a typed ta

Re: [GENERAL] What's the benefit (or usage scenario) of a "typed table"?

2016-12-31 Thread Thomas Kellerer
David G. Johnston schrieb am 31.12.2016 um 16:51: I wonder what the benefit of a typed table is and when this would be useful? But I'd say if you want a table with said structure you should plan on droppign the original type after you've altered all references to it to point to the new implici

Re: [GENERAL] What's the benefit (or usage scenario) of a "typed table"?

2016-12-31 Thread David G. Johnston
On Saturday, December 31, 2016, Thomas Kellerer wrote: > I recently stumbled over "typed tables" in Postgres > (there were several questions containing this on stackoverflow recently) > > create type some_type as (id integer, data text); > create table some_table of some_type; > > I wonde

[GENERAL] What's the benefit (or usage scenario) of a "typed table"?

2016-12-31 Thread Thomas Kellerer
I recently stumbled over "typed tables" in Postgres (there were several questions containing this on stackoverflow recently) create type some_type as (id integer, data text); create table some_table of some_type; I wonder what the benefit of a typed table is and when this would be useful

Re: [GENERAL] Performance PLV8 vs PLPGSQL

2016-12-31 Thread Tim Uckun
Yes I use a migrations tool as well. I like ruby so I use either the Sequel migrations or the ActiveRecord migrations depending on the project. That's a great way to work. Having said that I think it might be an interesting thing to do to create the PGAdmin hierarchy of objects on disk. Not the dat

Re: [GENERAL] How to convert MS SQL functions to pgSQL functions

2016-12-31 Thread Thomas Kellerer
Yogi Yang 007 schrieb am 31.12.2016 um 11:06: Hello, I am stuck while trying to convert/port a MS SQL server database to pgSQL. Here is the code of the function in MS SQL server: CREATE FUNCTION [dbo].[AccountGroupHierarchy] -- Description: ( @groupId numeric(18,0) ) RETURNS @table_variable

[GENERAL] How to convert MS SQL functions to pgSQL functions

2016-12-31 Thread Yogi Yang 007
Hello, I am stuck while trying to convert/port a MS SQL server database to pgSQL. Here is the code of the function in MS SQL server: CREATE FUNCTION [dbo].[AccountGroupHierarchy] -- Description: statement> ( @groupId numeric(18,0) ) RETURNS @table_variable TABLE (accountGroupId NUMERIC(18,0))