Re: [SQL] Union Question

2010-12-06 Thread bricklen
On Fri, Dec 3, 2010 at 8:58 AM, Plugge, Joe R. wrote: > Hello, > > I need to union three PostgreSQL tables and this won’t be a problem but the > tables are on different servers.  Basically, I have an administrative server > that needs the tables viewable in a web administrator and three query > se

Re: [SQL] The best option to insert data with primary id

2010-12-06 Thread mike
Quoting - : I know you can skip SEQUENCE - ((SELECT nextval ('seq_table')) do not put this in the query, my question was that such concurrency, and ids omitted which can not be inserted but increased with SEQUENCE ? In the initial message you have been wondering, if you should be worried abou

Re: [SQL] The best option to insert data with primary id

2010-12-06 Thread mike
Quoting - : I have a question about how best to insert and manipulate the table with primary key id for better productivity. I need to insert data into the table and get last id. 1. First option to take counter Postgres SEQUENCE: INSERT INTO table (id, ...) VALUES ((SELECT nextval ('seq_table')

[SQL] The best option to insert data with primary id

2010-12-06 Thread -
Hi everyone, I have a question about how best to insert and manipulate the table with primary key id for better productivity. I need to insert data into the table and get last id. 1. First option to take counter Postgres SEQUENCE: INSERT INTO table (id, ...) VALUES ((SELECT nextval ('seq_table'))

[SQL] First aggregate with null support

2010-12-06 Thread Marc Mamin
Hello, I'm looking for a First aggregate which may return null. From the example at http://wiki.postgresql.org/index.php?title=First_%28aggregate%29, I have just defined a non strict function that returns the first value: CREATE OR REPLACE FUNCTION public.first_agg_wnull ( anyelement, anyelement