[SQL] new table with a select

2011-08-25 Thread ppdcc
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? Can?t be a buffer, must be lines. Thanks -- Sent via pgsql-sql mailing lis

Re: [SQL] (pgsql8.4) DATA Corruption

2011-08-25 Thread Craig Ringer
On 20/08/2011 4:27 AM, Mik Rose wrote: Thanks for the suggestions Scott. I was looking at the zero_damage_page option and enabled it in my postgres.conf. I saw that it detected bad pages and zero'd them out during a number of reindex and a vacuum's. Now when i reindex though, I am getting

Re: [SQL] Need a little help with geometric query

2011-08-25 Thread Samuel Gendler
On Thu, Aug 25, 2011 at 3:56 PM, wrote: > This is my first shot at using postgresql's geometric functions > I have a passel of lines defined by x1 y1 x2 y2 > I created a table with type lseg and loaded it > I start by finding the line that has an end closest to 0,0 > Now I want to find the next l

Re: [SQL] st_offsetcurve

2011-08-25 Thread Brent Dombrowski
On Aug 25, 2011, at 1:17 PM, pp...@sapo.pt wrote: > > Hello > > > I want to use the function st_offsetCurve but the pgadmin don't have and i > don't find in the site of pgadmin. CAn anybody send me? > > thanks > > -- > Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) > To make cha

[SQL] Need a little help with geometric query

2011-08-25 Thread lxnf98mm
This is my first shot at using postgresql's geometric functions I have a passel of lines defined by x1 y1 x2 y2 I created a table with type lseg and loaded it I start by finding the line that has an end closest to 0,0 Now I want to find the next line that has an end closest to the first line's ot

[SQL] st_offsetcurve

2011-08-25 Thread ppdcc
Hello I want to use the function st_offsetCurve but the pgadmin don't have and i don't find in the site of pgadmin. CAn anybody send me? thanks -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] Add one column to another

2011-08-25 Thread vipul shah
Check this link. It's useful to resolve the issue. http://blog.ropardo.ro/2010/05/04/extending-postgresql-a-better-concat-operator/ - Vipul On Thu, Aug 25, 2011 at 12:54 PM, Scott Marlowe wrote: > On Thu, Aug 25, 2011 at 8:52 AM, Oliveiros d'Azevedo Cristina > wrote: > > Something like this.

Re: [SQL] Add one column to another

2011-08-25 Thread Scott Marlowe
On Thu, Aug 25, 2011 at 8:52 AM, Oliveiros d'Azevedo Cristina wrote: > Something like this...? > > SELECT first_name,surname, email1 || ';' || email2 > FROM t_your_table; If there's any nulls in email1 or email2 they'll need special handling with coalesce. -- Sent via pgsql-sql mailing list (pg

Re: [SQL] Add one column to another

2011-08-25 Thread Tim Landscheidt
(anonymous) wrote: > I have to deal with a table which contains: > first_name > surname > email1 > email2 > ... and I would like to create a view which combines both email columns thus: > first_name > surname > email > It looks simple but I can't think of an obvious query. Try: | SELECT firs

Re: [SQL] Add one column to another

2011-08-25 Thread David Johnston
I have to deal with a table which contains: first_name surname email1 email2 ... and I would like to create a view which combines both email columns thus: first_name surname email It looks simple but I can't think of an obvious query. ---

Re: [SQL] Add one column to another

2011-08-25 Thread Oliveiros d'Azevedo Cristina
Something like this...? SELECT first_name,surname, email1 || ';' || email2 FROM t_your_table; Best, Oliver - Original Message - From: "gvim" To: "pgsql sql" Sent: Thursday, August 25, 2011 3:21 PM Subject: [SQL] Add one column to another I have to deal with a table which contain

Re: [SQL] Add one column to another

2011-08-25 Thread Tony Capobianco
Use the concat || operator. On Thu, 2011-08-25 at 15:21 +0100, gvim wrote: > I have to deal with a table which contains: > > first_name > surname > email1 > email2 > > ... and I would like to create a view which combines both email columns thus: > > first_name > surname > email > > It looks s

[SQL] Add one column to another

2011-08-25 Thread gvim
I have to deal with a table which contains: first_name surname email1 email2 ... and I would like to create a view which combines both email columns thus: first_name surname email It looks simple but I can't think of an obvious query. gvim -- Sent via pgsql-sql mailing list (pgsql-sql@postgr

Re: [SQL] new table with a select

2011-08-25 Thread Florian Weimer
* Julien Cigar: > create table foo as select * from bar; > > just add "where 1=2" if you just want the schema There's also this: CREATE TABLE foo (LIKE bar); This gives you more control over what aspects of the table are duplicated; see the documentation for details. -- Florian Weimer

Re: [SQL] new table with a select

2011-08-25 Thread Julien Cigar
create table foo as select * from bar; just add "where 1=2" if you just want the schema On 08/25/2011 11:44, pp...@sapo.pt wrote: 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 ta

[SQL] new table with a select

2011-08-25 Thread ppdcc
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? Can?t be a buffer, must be lines. Thanks -- Sent via pgsql-sql mailing