On 05/27/2014 09:47 AM, saqibrafique wrote:
fm_db_Server1=# *select to_hex(to_number(substr(from_ip, 1, 3), '999')) as
price from operator;*
/ERROR: function to_hex(numeric) does not exist
LINE 1: select to_hex(to_number(substr(from_ip, 1, 3), '999')) as p...
^
There's no to
hi guys,
I am trying to convert a simple char value to HEX but I am getting Error.
*MyTable:*
CREATE TABLE mytable (from_ip CHAR(20), to_ip CHAR(20));
*I have below values in the Table:*
fm_db_Server1=# select * from operator;
from_ip|to_ip
---
saqibrafique wrote
> hi guys,
> I am trying to convert a simple char value to HEX but I am getting Error.
>
*
> MyTable:
*
>
> CREATE TABLE mytable (from_ip CHAR(20), to_ip CHAR(20));
*
> I have below values in the Table:
*
>
>
> fm_db_Server1=# select * from operator;
>from_ip
On 07/30/2012 07:36 AM, Little, Douglas wrote:
I have an input source that is in epoch time.Is there a built-in
conversion to changing to timestamp
http://www.postgresql.org/docs/9.1/interactive/functions-formatting.html
"
to_timestamp(double precision) timestamp with time zone convert Unix
On Jul 30, 2012, at 7:36 AM, Little, Douglas wrote:
> I have an input source that is in epoch time.Is there a built-in
> conversion to changing to timestamp
to_timestamp().
You can also do things like "select timestamptz 'epoch' + ? * interval '1
second'".
Cheers,
Steve
--
Sent via
"Little, Douglas" hat am 30. Juli 2012 um 16:36
geschrieben:
> I have an input source that is in epoch time.Is there a built-in
> conversion to changing to timestamp
>
>
>
select 'epoch'::date + * '1second'::interval;
Andreas
--
Sent via pgsql-general mailing list (pgsql-genera
I have an input source that is in epoch time.Is there a built-in conversion
to changing to timestamp
Thanks
Doug Little
Sr. Data Warehouse Architect | Business Intelligence Architecture | Orbitz
Worldwide
500 W. Madison, Suite 1000 Chicago IL 60661| Office 312.260.2588 | Fax
312.894.516
On 2012-06-29, Patrick Schneider wrote:
> Hello,
>
> is there any possibility to convert special columns during an CSV import
> via COPY?
> For example:
>
> HELLO;WORLD;;011001
>
> should be converted to a character field
do you mean like '' (easy) or like '香' or like '✏' (harder)
Em 29/06/2012 14:10, Raymond O'Donnell escreveu:
On 29/06/2012 08:54, Patrick Schneider wrote:
Hello,
is there any possibility to convert special columns during an CSV import
via COPY?
For example:
HELLO;WORLD;;011001
should be converted to a character field
011001 to the date 10th J
On 29 Jun 2012, at 9:54, Patrick Schneider wrote:
> Hello,
>
> is there any possibility to convert special columns during an CSV import via
> COPY?
> For example:
>
> HELLO;WORLD;;011001
>
> should be converted to a character field
> 011001 to the date 10th January 2001
>
> For the m
On 06/29/2012 12:54 AM, Patrick Schneider wrote:
Hello,
is there any possibility to convert special columns during an CSV
import via COPY?
For example:
HELLO;WORLD;;011001
should be converted to a character field
011001 to the date 10th January 2001
For the moment the only idea we
On 29/06/2012 08:54, Patrick Schneider wrote:
> Hello,
>
> is there any possibility to convert special columns during an CSV import
> via COPY?
> For example:
>
> HELLO;WORLD;;011001
>
> should be converted to a character field
> 011001 to the date 10th January 2001
>
> For the moment
Hello,
is there any possibility to convert special columns during an CSV import
via COPY?
For example:
HELLO;WORLD;;011001
should be converted to a character field
011001 to the date 10th January 2001
For the moment the only idea we have is, to import the CSV into a TEMP
table and
On Wed, Nov 19, 2008 at 12:50:23PM +0200, Andrus wrote:
> Sam,
> > SELECT MAX(nullif(regexp_replace(test, '^([0-9]*).*$', E'\\1'),'')::INT);
>
> Thank you.
> This seems to work but is bit slow.
It will have to be executed against every row before you get an answer,
so if you're just after the max
Sam,
Maybe something like:
SELECT MAX(nullif(regexp_replace(test, '^([0-9]*).*$', E'\\1'),'')::INT);
Thank you.
This seems to work but is bit slow.
How to speed it up ?
Should I create index
CREATE INDEX test ON test ( nullif(regexp_replace(test, '^([0-9]*).*$',
E'\\1'),'')::INT );
?
Raymond,
You could use a regular expression in substring() to get just the
numeric bits.
Thank you.
I do'nt have any experience on regex.
Can you provide a sample how to use regex to get numeric substring from
start of string ?
Andrus.
--
Sent via pgsql-general mailing list (pgsql-gener
On Tue, Nov 18, 2008 at 05:51:08PM +, Raymond O'Donnell wrote:
> You could use a regular expression in substring() to get just the
> numeric bits.
Thanks, never noticed that substring would accept a regexp before.
Syntax is a bit baroque, but it seems to work!
Sam
--
Sent via pgsql-gener
On Tue, Nov 18, 2008 at 07:33:47PM +0200, Andrus wrote:
> I need to obtain max integer considering only numbers from start of column
> up to first non-integer character.
>
> I tried
>
> create temp table test (test char(20));
> insert into test values ('12');
> insert into test values ('23/3');
On 18/11/2008 17:33, Andrus wrote:
> create temp table test (test char(20));
> insert into test values ('12');
> insert into test values ('23/3');
> insert into test values ('AX/3');
> select max(test::int) from test;
>
> but got
>
> ERROR: invalid input syntax for integer: "23/3 "
>
> Ho
Table contains CHAR(20) type columns containing numbers and other values.
I need to obtain max integer considering only numbers from start of column
up to first non-integer character.
I tried
create temp table test (test char(20));
insert into test values ('12');
insert into test values ('23/
On Saturday 05 April 2008 11:21, Tom Lane wrote:
> "Scott Marlowe" <[EMAIL PROTECTED]> writes:
> > what type is new.ontime ?? timestamp or interval. I would expect it
> > to be an interval. But intervals are either negative or positive, not
> > "ago" unless that's something peculiar to 7.4 that
On Friday 04 April 2008 16:36, Tom Lane wrote:
> Terry Lee Tucker <[EMAIL PROTECTED]> writes:
> > I am converting our application from 7.4.19 to 8.3.1. In the old scheme
> > of things, I was generating an interval between two timestamps and
> > evaluating the interval string in another set of trigg
"Scott Marlowe" <[EMAIL PROTECTED]> writes:
> what type is new.ontime ?? timestamp or interval. I would expect it
> to be an interval. But intervals are either negative or positive, not
> "ago" unless that's something peculiar to 7.4 that I've long since
> forgotten.
No, it's still around:
re
On Fri, Apr 4, 2008 at 2:39 PM, Terry Lee Tucker <[EMAIL PROTECTED]> wrote:
> On Friday 04 April 2008 15:01, Craig Ringer wrote:
>
> > Terry Lee Tucker wrote:
> > > Greetings:
> > >
> > > I am converting our application from 7.4.19 to 8.3.1. In the old scheme
> > > of things, I was generating a
On Friday 04 April 2008 16:36, Tom Lane wrote:
> Terry Lee Tucker <[EMAIL PROTECTED]> writes:
> > I am converting our application from 7.4.19 to 8.3.1. In the old scheme
> > of things, I was generating an interval between two timestamps and
> > evaluating the interval string in another set of trigg
On Friday 04 April 2008 15:01, Craig Ringer wrote:
> Terry Lee Tucker wrote:
> > Greetings:
> >
> > I am converting our application from 7.4.19 to 8.3.1. In the old scheme
> > of things, I was generating an interval between two timestamps and
> > evaluating the interval string in another set of tri
Terry Lee Tucker <[EMAIL PROTECTED]> writes:
> I am converting our application from 7.4.19 to 8.3.1. In the old scheme of
> things, I was generating an interval between two timestamps and evaluating
> the interval string in another set of trigger code. I was doing the
> following:
> IF new.ontim
Terry Lee Tucker wrote:
Greetings:
I am converting our application from 7.4.19 to 8.3.1. In the old scheme of
things, I was generating an interval between two timestamps and evaluating
the interval string in another set of trigger code. I was doing the
following:
IF new.ontime IS NOT NULL AN
Greetings:
I am converting our application from 7.4.19 to 8.3.1. In the old scheme of
things, I was generating an interval between two timestamps and evaluating
the interval string in another set of trigger code. I was doing the
following:
IF new.ontime IS NOT NULL AND new.ontime ~* 'ago' THEN
On Fri, Aug 12, 2005 at 11:36:01PM +0800, Richard Sydney-Smith wrote:
> if a new command were available to transfer between schemas then the
> wishlist would eventually extend to ...
>
> transfer [table] [view] [rule] public.* to schema yyy;
>
> Where * would mean all entries of the selected typ
I have a database which over many years and clients has grown to about
140 tables with attendant triggers , rules and views. Having transferred
to the postgresql community from another database provider the design
did not include the use of schema.
During a recent review it struck me just how use
"Nathan Suderman" <[EMAIL PROTECTED]> writes:
> how can I convert varchar to int? I can not seem to cast the type
> (::int2) and there are no conversion functions in the docs
> (int(varchar)).
What Postgres version are you using? This works fine for me in 7.0
and later...
On Sat, 28 Oct 2000, William H. Geiger III wrote:
> Hi,
>
> I am new to PostgreSQL and I am trying to convert a MySQL database over.
> There are a couple of basics I need to clear up:
>
> On the numeric INT types can they be set to unsigned? I have 32-bit &
> 64bit unsigned integers that I need
Hi,
I am new to PostgreSQL and I am trying to convert a MySQL database over.
There are a couple of basics I need to clear up:
On the numeric INT types can they be set to unsigned? I have 32-bit &
64bit unsigned integers that I need to store in the majority of the tables
in the database. All the
grate your yes/no
fields to int2.
David Boerwinkle
-Original Message-
From: Mihai Gheorghiu <[EMAIL PROTECTED]>
To: Stephen Davies <[EMAIL PROTECTED]>; G.L.Lim
<[EMAIL PROTECTED]>
Cc: [EMAIL PROTECTED]
<[EMAIL PROTECTED]>
Date: Tuesday, June 27, 2000 9:07 AM
Subject
.L.Lim <[EMAIL PROTECTED]>
Cc: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Monday, June 26, 2000 7:54 PM
Subject: Re: [GENERAL] Conversion from MS Access to Postgresql
>G'day.
>
>Having just done it, I can confirm that converting an Access database
>to PostgreSQL is ver
"Len Morgan" <[EMAIL PROTECTED]> writes:
> ... I cannot seem to make Postgres join two
> tables when the type of one is char(9) and the other is character
> varying(9). The machine seems to go into an endless loop.
What? Specific example, please.
> A similar problem I have is with fix precisi
Hello Len,
Once, Tuesday, June 27, 2000, 4:22:08 AM, you wrote:
LM> While we're on the subject of Access/Postgres, I have a consistent problem
LM> in moving tables between Access and Postgres. Access doesn't seem to want
LM> to export a fixed length character field (i.e., I have a text field th
38 matches
Mail list logo