Re: [SQL] parsing a string with a hexadecimal notation

2005-02-10 Thread KÖPFERL Robert

> So it should work to do "SELECT int4($1::bit varying)" and then pass
> 'xBEEF' as the string value for the parameter.
> 
>   regards, tom lane

Thanks, that worked for me 

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


[SQL] postgres 8 data directory other then default?

2005-02-10 Thread Joel Fradkin








I am trying to use a different drive for the data.

I have edited postgres.conf to point to the new location,
but I get the error /pgdata/PG_VERSION is missing.

Do I have to do a initdb?

When I try an initdb it says it is not empty. (has lost and
found folder in it).

Fedora Core 3 linux.

I was able to do an init db if I create a folder called data
in the pgdata, but I was not sure if it then would use that folder for all the
files (I just want my data to be there).

I also want to move my wal files to the /wal drives once I
get it to start using pgdata drive for data.

 

I got some info on this

0) backup your data

1) stop postmaster and
verify.

2) cd $PGDATA; mv pg_xlog original_pg_xlog;
ln -s /wal pg_xlog; cp 

original_pg_xlog/* pg_xlog

3) start postmaster and
confirm correct startup in log files.

 

Will this work? I am guessing this info would be in the var/lib
folder not the /pgdata folder?

Thanks in advance and sorry for asking so many dumb newb
questions.

Least this time the install of 8 went super smooth, just
went to the postgres site and got the rpm’s (Since I did not install 7
with the OS it asked for the fedora cd’s a few times but all rpm’s
went ok).

 

On the 8.1 files which are in tar files do I need to get
those as well to get to 8.1 if so what is the procedure other then copying the
files to my system (I have the .tar.bz)

 

 

Joel Fradkin



 



Wazagua, Inc.
2520 Trailmate Dr
Sarasota, Florida 34243
Tel.  941-753-7111 ext 305



 



[EMAIL PROTECTED]
www.wazagua.com
Powered by Wazagua
Providing you with the latest Web-based technology & advanced tools.
© 2004. WAZAGUA, Inc. All rights reserved. WAZAGUA, Inc
 This email message is for the use of the intended recipient(s) and may
contain confidential and privileged information.  Any unauthorized review,
use, disclosure or distribution is prohibited.  If you are not the
intended recipient, please contact the sender by reply email and delete and
destroy all copies of the original message, including attachments.



 




 

 








[SQL] postgres 8 data directory other then default?

2005-02-10 Thread Joel Fradkin
I am trying to use a different drive for the data.
I have edited postgres.conf to point to the new location, but I get the
error /pgdata/PG_VERSION is missing.
Do I have to do a initdb?
When I try an initdb it says it is not empty. (has lost and found folder in
it).
Fedora Core 3 linux.
I was able to do an init db if I create a folder called data in the pgdata,
but I was not sure if it then would use that folder for all the files (I
just want my data to be there).
I also want to move my wal files to the /wal drives once I get it to start
using pgdata drive for data.
 
I got some info on this
0) backup your data
1) stop postmaster and verify.
2) cd $PGDATA; mv pg_xlog original_pg_xlog; ln -s /wal pg_xlog; cp 
original_pg_xlog/* pg_xlog
3) start postmaster and confirm correct startup in log files.
 
Will this work? I am guessing this info would be in the var/lib folder not
the /pgdata folder?
Thanks in advance and sorry for asking so many dumb newb questions.
Least this time the install of 8 went super smooth, just went to the
postgres site and got the rpm’s (Since I did not install 7 with the OS it
asked for the fedora cd’s a few times but all rpm’s went ok).
 
On the 8.1 files which are in tar files do I need to get those as well to
get to 8.1 if so what is the procedure other then copying the files to my
system (I have the .tar.bz)
 
 
Joel Fradkin
 
Wazagua, Inc.
2520 Trailmate Dr
Sarasota, Florida 34243
Tel.  941-753-7111 ext 305
 
[EMAIL PROTECTED]
www.wazagua.com
Powered by Wazagua
Providing you with the latest Web-based technology & advanced tools.
© 2004. WAZAGUA, Inc. All rights reserved. WAZAGUA, Inc
 This email message is for the use of the intended recipient(s) and may
contain confidential and privileged information.  Any unauthorized review,
use, disclosure or distribution is prohibited.  If you are not the intended
recipient, please contact the sender by reply email and delete and destroy
all copies of the original message, including attachments.
 

 
 


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


[SQL] append fields for *where...*

2005-02-10 Thread Johnny C
I have the following tables:

TABLE A
month   |   year   |   item |   num
1  2005  myitem 003

TABLE B
num|   date |  descr
003 02-01-2005  blahblah
003 01-01-2005  toratora

I am trying to come up with something like:
select date,item,descr from TABLEA a 
LEFT OUTER JOIN TABLEB b ON  b.num=a.num
WHERE date=month-01-year;

How can you make month (append) - 01 - (append) year? and
pass that as a condition to the field date? Is this possible?

---(end of broadcast)---
TIP 6: Have you searched our list archives?

   http://archives.postgresql.org


Re: [SQL] append fields for *where...*

2005-02-10 Thread Bruno Wolff III
On Thu, Feb 10, 2005 at 17:45:11 -0500,
  Johnny C <[EMAIL PROTECTED]> wrote:
> 
> How can you make month (append) - 01 - (append) year? and
> pass that as a condition to the field date? Is this possible?

You can EXTRACT the day of the month from the date. If you need this
to use an index, you can create a functional index.

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster