Re: [SQL] Dropping Functions

2008-03-26 Thread Shawn
On Thursday 27 March 2008 00:13:26 Adrian Klaver wrote: > On Wednesday 26 March 2008 5:05 pm, Shawn wrote: > > Hi Guys, > > > > Just a quick question. Is there a known problem with dropping function > > in 8.2.6? I can make them but they can't be deleted. > > > > Shawn > > They will not deleted i

Re: [SQL] Dropping Functions

2008-03-26 Thread Adrian Klaver
On Wednesday 26 March 2008 5:05 pm, Shawn wrote: > Hi Guys, > > Just a quick question. Is there a known problem with dropping function in > 8.2.6? I can make them but they can't be deleted. > > Shawn They will not deleted if something else depends on them i.e. a trigger. Can you show the error m

[SQL] Dropping Functions

2008-03-26 Thread Shawn
Hi Guys, Just a quick question. Is there a known problem with dropping function in 8.2.6? I can make them but they can't be deleted. Shawn -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: FW: Re: [SQL] Part 1 of several - Converting a varchar to an interval

2008-03-26 Thread Shawn
On Wednesday 26 March 2008 23:12:07 Rodrigo E. De León Plicet wrote: > Use dollar quoting, e.g.: > > create or replace function dur_interval_msec(int) returns interval > as > $$ > select ($1 * interval '1 msec'); > $$ > language sql > immutable > returns null on null input; Perfect! Great! Thank

Re: FW: Re: [SQL] Part 1 of several - Converting a varchar to an interval

2008-03-26 Thread Rodrigo E. De León Plicet
On Wed, Mar 26, 2008 at 5:45 PM, Shawn <[EMAIL PROTECTED]> wrote: > obviously it doesn't like the extra single quotes around the 1 msec. Any > suggestions for a work around? Use dollar quoting, e.g.: create or replace function dur_interval_msec(int) returns interval as $$ select ($1 * interval

Re: FW: Re: [SQL] Part 1 of several - Converting a varchar to an interval

2008-03-26 Thread Shawn
On Wednesday 26 March 2008 17:14:28 Tom Lane wrote: > Or even easier: > > regression=# select 134987 * interval '1 msec'; >    ?column?   > -- >  00:02:14.987 > (1 row) > > > regards, tom lane Tom and Adrian, i am trying to incorporate the solution you gave int

Re: FW: Re: [SQL] Part 1 of several - Converting a varchar to an interval

2008-03-26 Thread Adrian Klaver
-- Original message -- From: Tom Lane <[EMAIL PROTECTED]> > [EMAIL PROTECTED] (Adrian Klaver) writes: > > Select 134987 * interval '1 msec'; > > ERROR: invalid input syntax for type interval: "1 msec" > > > SELECT version(); > >

Re: [SQL] Bizarre sort order

2008-03-26 Thread Tom Lane
"Conlon, Joseph F SIK" <[EMAIL PROTECTED]> writes: > Does anyone think this is the correct behavior? If you don't think so, you need to change to C locale. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your su

[SQL] Bizarre sort order

2008-03-26 Thread Conlon, Joseph F SIK
Does anyone think this is the correct behavior? adaps_db=# select * from upc_usage order by 1 ; usage -- 53E ABC CYPHER _GENERAL H66 HAWK _JOE RSRA S61 S65 S70 S76 S92 XWING (14 rows) It appears to be ignoring the underscore! Database has LATIN1 encoding and was recently

[SQL] Finding all References to a Primary Key

2008-03-26 Thread Matthew T. O'Connor
I'm sorry if this is has been discussed, but I tried to find the answer in the archives and failed, so... How do I find all the rows in other tables that reference a specific row in another table? I'm only trying to find rows that are in tables where there is a Foreign Key referencing the pri

Re: FW: Re: [SQL] Part 1 of several - Converting a varchar to an interval

2008-03-26 Thread Tom Lane
[EMAIL PROTECTED] (Adrian Klaver) writes: > Select 134987 * interval '1 msec'; > ERROR: invalid input syntax for type interval: "1 msec" > SELECT version(); > version >

Re: FW: Re: [SQL] Part 1 of several - Converting a varchar to an interval

2008-03-26 Thread Adrian Klaver
-- Original message -- From: Tom Lane <[EMAIL PROTECTED]> > [EMAIL PROTECTED] (Adrian Klaver) writes: > > select ('134987'::int/1000.00) * interval ' 1 second' ; > > ?column? > > -- > > 00:02:14.987 > > (1 row) > > Or even easier: > > regres

Re: FW: Re: [SQL] Part 1 of several - Converting a varchar to an interval

2008-03-26 Thread Adrian Klaver
-- Original message -- From: Tom Lane <[EMAIL PROTECTED]> > [EMAIL PROTECTED] (Adrian Klaver) writes: > > select ('134987'::int/1000.00) * interval ' 1 second' ; > > ?column? > > -- > > 00:02:14.987 > > (1 row) > > Or even easier: > > regressi

Re: FW: Re: [SQL] Part 1 of several - Converting a varchar to an interval

2008-03-26 Thread Tom Lane
[EMAIL PROTECTED] (Adrian Klaver) writes: > select ('134987'::int/1000.00) * interval ' 1 second' ; > ?column? > -- > 00:02:14.987 > (1 row) Or even easier: regression=# select 134987 * interval '1 msec'; ?column? -- 00:02:14.987 (1 row)

FW: Re: [SQL] Part 1 of several - Converting a varchar to an interval

2008-03-26 Thread Adrian Klaver
-- Forwarded Message: -- From: [EMAIL PROTECTED] (Adrian Klaver) To: Shawn <[EMAIL PROTECTED]> Subject: Re: [SQL] Part 1 of several - Converting a varchar to an interval Date: Wed, 26 Mar 2008 16:16:58 + > > > > > -- Original message ---

Re: [SQL] Question 2 Interval and timestamptz

2008-03-26 Thread Shawn
Awesome Adrian! Thanks! Just what I needed. On Wednesday 26 March 2008 16:24:34 you wrote: > -- Original message -- > From: Shawn <[EMAIL PROTECTED]> > > > Hello! > > > > The second part of my question is: > > > > Given a value as an interval, see previous p

FW: Re: [SQL] Question 2 Interval and timestamptz

2008-03-26 Thread Adrian Klaver
-- Forwarded Message: -- From: [EMAIL PROTECTED] (Adrian Klaver) To: Shawn <[EMAIL PROTECTED]> Subject: Re: [SQL] Question 2 Interval and timestamptz Date: Wed, 26 Mar 2008 16:24:39 + > > -- Original message -- > From: Shawn <[EMAIL PRO

Re: [SQL] Part 1 of several - Converting a varchar to an interval

2008-03-26 Thread Shawn
On Wednesday 26 March 2008 16:16:57 you wrote: > select ('134987'::int/1000.00) * interval ' 1 second' ; >    ?column? > -- >  00:02:14.987 > (1 row) Thanks Adrian! Wow! Shawn -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: h

Re: [SQL] Export Access 97 to PostgreSQL

2008-03-26 Thread Shane Ambler
Shavonne Marietta Wijesinghe wrote: Hello I have a db in MS Access 97 and now i have to import the data in PostgreSQL. I can create the table structure in PostgreSql but in what format can i export the table from Access so Postgresql can read it? csv would be the most common and easiest. Basi

Re: [SQL] Export Access 97 to PostgreSQL

2008-03-26 Thread Shawn
On Wednesday 26 March 2008 11:46:43 Shavonne Marietta Wijesinghe wrote: > Hello > > I have a db in MS Access 97 and now i have to import the data in > PostgreSQL. I can create the table structure in PostgreSql but in what > format can i export the table from Access so Postgresql can read it? > > Th

[SQL] Question 2 Interval and timestamptz

2008-03-26 Thread Shawn
Hello! The second part of my question is: Given a value as an interval, see previous posting, is there a simply method to take a given timestamptz value and a given interval value and create the sum or difference of the 2 in timestamptz format? The scenario is that the afore mentioned tables,

[SQL] Part 1 of several - Converting a varchar to an interval

2008-03-26 Thread Shawn
Hello, I have several large tables, over 100 million records each. One of the fields is callee 'duration'. It is a varchar that contains what is essentially an integer that is the duration of an event in milleseconds. Could someone tell me a simple way to convert a value such as 134987 store

[SQL] Export Access 97 to PostgreSQL

2008-03-26 Thread Shavonne Marietta Wijesinghe
Hello I have a db in MS Access 97 and now i have to import the data in PostgreSQL. I can create the table structure in PostgreSql but in what format can i export the table from Access so Postgresql can read it? Thanks Shavonne