Re: [SQL] new table with a select

2011-08-26 Thread MIkhail Puzanov
Hi, 2011/8/25 > Hello to all, > > > Can anybody tell me the sql instruction to create a new table with a select > of other table? > > I need to create a new table based on paralell of a table of lines. Can > anybody post to me a example? > > CREATE TABLE t AS SELECT * FROM x;

Re: [SQL] atomic multi-threaded upsert

2010-11-24 Thread MIkhail Puzanov
2010/11/25 KM > On 2010-11-24, "Mikhail V. Puzanov" wrote: > > Next, I execute the following two queries for that table: > > > >-- increment and get the counter if exists > > UPDATE sequences SET counter = counter + 1 > > WHERE section = 'testSection' AND name = 'testKey' > > RETURNING

Re: [SQL] atomic multi-threaded upsert

2010-11-24 Thread MIkhail Puzanov
2010/11/25 Tom Lane > "Mikhail V. Puzanov" writes: > >-- increment and get the counter if exists > > UPDATE sequences SET counter = counter + 1 > > WHERE section = 'testSection' AND name = 'testKey' > > RETURNING counter; > > Seems that what you have here is a bad manual implementation

Re: [SQL] UUID for Postgresql 8.4

2010-07-21 Thread MIkhail Puzanov
There's contrib module for it, uuid-ossp. It should be available as a package for most OSes and distributions, I guess. Hi All, > > I have a column in my Postgresql database tables which need UUID. > > Is there any function in Pgsql for UUID generation. Please help me in this > regard. > > -- > R