[SQL] Postgresql format for ISO8601

2010-03-17 Thread Arnab Ghosh
Hello Friends, I want to format a timstamp with timezone column with ISO 8601 FORMAT ( []-[MM]-[DD]T[hh]:[mm]Z) Please let me know how to format?? I had tried with to_char but unable to format to ISO-8601 format. Thanks, Arnab Ghosh

Re: [SQL] Postgresql format for ISO8601

2010-03-17 Thread A. Kretschmer
In response to Arnab Ghosh : > Hello Friends, > > I want to format a timstamp with timezone column with ISO 8601 FORMAT ([]- > [MM]-[DD]T[hh]:[mm]Z) > > Please let me know how to format?? I had tried with to_char but unable to > format to ISO-8601 format. Don't know much about ISO 8601, but

[SQL] select points of polygons

2010-03-17 Thread Andreas Gaab
Hi there, I have polygons with 5 points (left, center, right, top, bottom) Now I would like to select an individual point out of the polygon. Are there any functions to provide this in an readable manner other than: e.g. SELECT replace(split_part(p::text,',(',1),'((','(')::point as point FROM

Re: [SQL] pgAgent stats

2010-03-17 Thread Guillaume Lelarge
Hi, Le 16/03/2010 08:40, Marcin Krawczyk a écrit : > Hi list, does anyone know the reason for pgAdmin not showing the stats > neither for selected pgAgent step nor whole job ? The pga_joblog and > pga_jobsteplog both get populated with data on run so I was thinking that > maybe I'm missing some vi

Re: [SQL] pgAgent stats

2010-03-17 Thread Marcin Krawczyk
It's pgAdmin 1.10.0. I've partially identified the problem, pgAdmin log says that following query gets executed when switching to job statistics tab : SELECT jsljlgid, jslstatus, jslresult, jslstart, jslduration, (jslstart + jslduration) AS endtime, jsloutput FROM pgagent.pga_jobsteplog WHERE jslj

Re: [SQL] pgAgent stats

2010-03-17 Thread Dave Page
On Wed, Mar 17, 2010 at 12:15 PM, Marcin Krawczyk wrote: > It's pgAdmin 1.10.0. I've partially identified the problem, pgAdmin log says > that following query gets executed when switching to job statistics tab : > SELECT jsljlgid, jslstatus, jslresult, jslstart, jslduration, (jslstart + > jsldurat

Re: [SQL] pgAgent stats

2010-03-17 Thread Marcin Krawczyk
Ha, it worked :)) kind of funny though. It was set to 0 but it's supposed to not limit anything when 0 :)) a bug ? pozdrowienia / regards / salutations mk 2010/3/17 Dave Page > On Wed, Mar 17, 2010 at 12:15 PM, Marcin Krawczyk > wrote: > > It's pgAdmin 1.10.0. I've partially identified the p

[SQL] Postgresql format for ISO8601

2010-03-17 Thread Arnab Ghosh
Hello Friends, I have tried with to_char. But unable to find out how to show offset of difference in timezone. ISO 8601 Timezone Example - 1994-11-05T08:15:30-05:00 corresponds to November 5, 1994, 8:15:30 am, US Eastern Standard Time. 1994-11-05T13:15:30Z corresponds to the same instant. Thank

Re: [SQL] pgAgent stats

2010-03-17 Thread Dave Page
On Wed, Mar 17, 2010 at 12:24 PM, Marcin Krawczyk wrote: > Ha, it worked :)) kind of funny though. It was set to 0 but it's supposed to > not limit anything when 0 :)) a bug ? What makes you say that? The docs say: Maximum rows to retrieve - This option specifies the number of job and job step s

Re: [SQL] pgAgent stats

2010-03-17 Thread Marcin Krawczyk
Yeah... my bad. Sorry for being a pain in the a... ;) pozdrowienia mk 2010/3/17 Dave Page > On Wed, Mar 17, 2010 at 12:24 PM, Marcin Krawczyk > wrote: > > Ha, it worked :)) kind of funny though. It was set to 0 but it's supposed > to > > not limit anything when 0 :)) a bug ? > > What makes y

Re: [SQL] pgAgent stats

2010-03-17 Thread Marcin Krawczyk
Thanks for your help guys. regards mk 2010/3/17 Dave Page > On Wed, Mar 17, 2010 at 12:24 PM, Marcin Krawczyk > wrote: > > Ha, it worked :)) kind of funny though. It was set to 0 but it's supposed > to > > not limit anything when 0 :)) a bug ? > > What makes you say that? The docs say: > > M

Re: [SQL] pgAgent stats

2010-03-17 Thread Dave Page
:-) On Wed, Mar 17, 2010 at 12:40 PM, Marcin Krawczyk wrote: > Yeah... my bad. Sorry for being a pain in the a... ;) > > pozdrowienia > mk > > > 2010/3/17 Dave Page >> >> On Wed, Mar 17, 2010 at 12:24 PM, Marcin Krawczyk >> wrote: >> > Ha, it worked :)) kind of funny though. It was set to 0 but

[SQL] inheritance

2010-03-17 Thread Zdravko Balorda
Hi, I am new to postgress inheritance. Once a parent row is inserted can I later reconnect child rows so that thay get adopted by parent row? Regards, Zdravko. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpre

Re: [SQL] Postgresql format for ISO8601

2010-03-17 Thread Tom Lane
Arnab Ghosh writes: > ISO 8601 Timezone Example - > 1994-11-05T08:15:30-05:00 corresponds to November 5, 1994, 8:15:30 am, US > Eastern Standard Time. AIUI, the T is optional per spec and therefore PG's default timestamp output format already meets the 8601 standard. reg

Re: [SQL] select points of polygons

2010-03-17 Thread Tom Lane
Andreas Gaab writes: > I have polygons with 5 points (left, center, right, top, bottom) > Now I would like to select an individual point out of the polygon. Are > there any functions to provide this Doesn't look like it :-(. Seems like rather an oversight. regards, tom

[SQL] 8.4 versus 8.2 against nonexistent column "name" ...

2010-03-17 Thread James Robinson
Can anyone shine a light on why 8.4 behaves surprisingly when being queried for a bogus column "name", but only using qualified table/ column references. Here's a sample script: - create table foo ( id int, x int ); insert into foo(id, x) values (1, 23), (

Re: [SQL] 8.4 versus 8.2 against nonexistent column "name" ...

2010-03-17 Thread Osvaldo Kussama
2010/3/17 James Robinson : > Can anyone shine a light on why 8.4 behaves surprisingly when being queried > for a bogus column "name", but only using qualified table/column references. > > Here's a sample script: > > - > create table foo > ( >        id int, >        x int > ); > > insert into f

[SQL] strange issue with UUID data types

2010-03-17 Thread Michael Gould
I'm running Windows 2008 64 bit server with Postgres 8.4.2 (also have tried Windows 7 both 32 and 64 bit).  The origin database is SQL Anywhere 10. I've got several tables that have a UUID data type with isscontrib.uuid_generate_v4() as the default value.  All of the tables where these are the

Re: [SQL] strange issue with UUID data types

2010-03-17 Thread Rob Sargent
On 03/17/2010 10:29 AM, Michael Gould wrote: > I'm running Windows 2008 64 bit server with Postgres 8.4.2 (also have > tried Windows 7 both 32 and 64 bit). The origin database is SQL > Anywhere 10. > > I've got several tables that have a UUID data type with > isscontrib.uuid_generate_v4() as th

Re: [SQL] Avoiding cycles in a directed graph

2010-03-17 Thread Tony Cebzanov
On 3/16/10 6:22 PM, Tom Lane wrote: > Richard Huxton writes: > > > Um, what if the cycle is being formed from whole cloth? For instance > T1 inserts an edge A->B while T2 is inserting B->A. There are no > pre-existing rows to lock, but there will still be a cycle after they > both commit. For

[SQL] MSSQL to PostgreSQL - Issue trying to generate unique ID using actual date

2010-03-17 Thread Ignacio Balcarce
Hi all, I am facing a problem trying to convert from MSSQL procedure to PostgreSQL function. CREATE PROCEDURE dbo.THUBAN_SP_GENERATEID @NEWID VARCHAR(20) OUTPUT AS SET @NEWID = ( SELECT REPLACE(SUBSTRING(CONVERT(CHAR(10),GETDATE(

Re: [SQL] strange issue with UUID data types

2010-03-17 Thread Michael Gould
" > Given my recent history re: uuid's perhaps I shouldn't chime in here, > but can't help myself. > > get/run pg_config to see how postgres was built and installed. It may > be using ossp uuid support? I ran this and it showed that ossp uuid were turned on. This build is the windows installer