Re: [GENERAL] Converting 7.x to 8.x

2007-01-24 Thread Bruno Wolff III
On Thu, Jan 25, 2007 at 15:43:19 +1100, Chris <[EMAIL PROTECTED]> wrote: > Carlos wrote: > >What would be the faster way to convert a 7.4.x database into an 8.x > >database? A dump of the database takes over 20 hours so we want to > >convert the database without having to do a dump and resptor

Re: [GENERAL] indexing primary and foreign keys w/lookup table

2007-01-24 Thread Bruno Wolff III
On Wed, Jan 24, 2007 at 20:14:07 -0800, Neal Clark <[EMAIL PROTECTED]> wrote: > I was wondering...I currently have indexes on the primary key id and > foreign key id's for tables that resemble the following. Is this a > good idea/when would it benefit me? I don't want waste a lot of > unnec

Re: [GENERAL] Example of RETURNING clause to get auto-generated keys

2007-01-24 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > Ken Johanson wrote: >> Just to be sure, will the RETURNING clause work with custom sequences >> (say, non numeric or increment by two) or other types of key >> generators?... And how will triggers interfere with it (if at all)? > As far as I know, RET

Re: [GENERAL] indexing primary and foreign keys w/lookup table

2007-01-24 Thread Merlin Moncure
On 1/25/07, Neal Clark <[EMAIL PROTECTED]> wrote: I was wondering...I currently have indexes on the primary key id and foreign key id's for tables that resemble the following. Is this a good idea/when would it benefit me? I don't want waste a lot of unnecessary space on indexes. CREATE TABLE s

Re: [GENERAL] Converting 7.x to 8.x

2007-01-24 Thread Chris
Carlos wrote: What would be the faster way to convert a 7.4.x database into an 8.x database? A dump of the database takes over 20 hours so we want to convert the database without having to do a dump and resptore. That's your only option as far as I know (I'm sure someone will correct me if t

Re: [GENERAL] indexing primary and foreign keys w/lookup table

2007-01-24 Thread Chris
CREATE TABLE stuff_by_account ( account_idBIGINT REFERENCES accounts(id), stuff_idBIGINT REFERENCES stuff(id) ); CREATE INDEX stuff_by_account_account_id ON stuff_by_account(account_id); CREATE INDEX stuff_by_account_stuff_id ON stuff_by_account(stuff_id); do I need any/all of t

[GENERAL] indexing primary and foreign keys w/lookup table

2007-01-24 Thread Neal Clark
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi All. I was wondering...I currently have indexes on the primary key id and foreign key id's for tables that resemble the following. Is this a good idea/when would it benefit me? I don't want waste a lot of unnecessary space on indexes. CREA

Re: [GENERAL] Example of RETURNING clause to get auto-generated keys

2007-01-24 Thread Alvaro Herrera
Ken Johanson wrote: > > > >Now playing devil's advocate, can anyone see scenarios where this will > >not work as expected? Examples (descriptions not sql necessarily) of > >those would be helpful too... > > > > Just to be sure, will the RETURNING clause work with custom sequences > (say, non nu

Re: [GENERAL] Example of RETURNING clause to get auto-generated keys

2007-01-24 Thread John D. Burger
Ken Johanson wrote: Just to be sure, will the RETURNING clause work with custom sequences (say, non numeric or increment by two) or other types of key generators?... And how will triggers interfere with it (if at all)? RETURNING has nothing to do with sequences per se - it's just a way

Re: [GENERAL] Idle in transaction - Explination ..

2007-01-24 Thread Merlin Moncure
On 1/25/07, Weslee Bilodeau <[EMAIL PROTECTED]> wrote: Where I work I'm in charge of more then a few PostgreSQL databases. I understand why idle in transaction is bad, however I have some developers who I'm having a real difficult time fully explaining to them why its bad. Oh, and by bad I mean

Re: [GENERAL] Problem with replace

2007-01-24 Thread Merlin Moncure
On 23 Jan 2007 13:05:41 -0800, slawosz <[EMAIL PROTECTED]> wrote: Hello, I have to relpace string http://example.com/index.php?module=articles&id= to string /module/ in whole column in table. How exacly use replace? I noob in postgres, I think it could be quite easy. Please, help try replace co

Re: [GENERAL] Example of RETURNING clause to get auto-generated keys

2007-01-24 Thread Ken Johanson
Now playing devil's advocate, can anyone see scenarios where this will not work as expected? Examples (descriptions not sql necessarily) of those would be helpful too... Just to be sure, will the RETURNING clause work with custom sequences (say, non numeric or increment by two) or other ty

Re: [GENERAL] Example of RETURNING clause to get auto-generated keys

2007-01-24 Thread Ken Johanson
Adam Rich wrote: Let's say you have a table with "id, value" columns. And your normal query would be this: INSERT into mytable (id,value) values (1,"foo"),(2,"bar"); Your new query would be like this: INSERT into mytable (id,value) values (1,"foo"),(2,"bar") RETURNING id; And you would get a

Re: [GENERAL] Cannot Restart PostgreSQL-8.1.4

2007-01-24 Thread Rich Shepard
On Wed, 24 Jan 2007, Tom Lane wrote: Somehow DBD::Pg picked up the wrong (older) version of libpq.so; you need to look into why. Wrong search path while building maybe? Tom, I _thought_ that might be what happened, but I wanted to make sure before I dug myself into a hole. You are absol

Re: [GENERAL] Cannot Restart PostgreSQL-8.1.4

2007-01-24 Thread Tom Lane
Rich Shepard <[EMAIL PROTECTED]> writes: >I'm not following you. DBD::Pg is the most current version (1.49 from May > 2006). That I built and installed this morning. It's calling > /usr/lib/libpg.so.3.1, but I also have /usr/lib/ligpg.so.4.1. Somehow DBD::Pg picked up the wrong (older) version

Re: [GENERAL] Cannot Restart PostgreSQL-8.1.4

2007-01-24 Thread Rich Shepard
On Wed, 24 Jan 2007, Alan Hodgson wrote: It'll be whatever version the DBD::Pg module is compiled to use. Just rebuilding and installing an updated version of that package will likely fix your problem. Alan, I'm not following you. DBD::Pg is the most current version (1.49 from May 2006). T

Re: [GENERAL] column insert/alter got me stumped!

2007-01-24 Thread Adam Rich
I think you want this: update tablename set columname = 'value' where column2 = 'value2'; -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of John Smith Sent: Wednesday, January 24, 2007 5:59 PM To: pgsql-general@postgresql.org Subject: [GENERAL] column in

[GENERAL] column insert/alter got me stumped!

2007-01-24 Thread John Smith
guys, just wanna change value of 1 existing column # insert into tablename (columnname) values ('value'); ...works # select columnname from tablename where columnname='value'; ...works # insert into tablename (columnname) values ('value') select columnname from tablename where columnname='value

Re: [GENERAL] Installing PostgreSQL under Cpanel

2007-01-24 Thread Douglas McNaught
Have you read http://www.postgresql.org/docs/8.2/static/tutorial.html ?? If there are specific parts in there that are unclear or missing I'm sure the developers would be happy to know. -Doug ---(end of broadcast)--- TIP 9: In versions below 8.0,

Re: [GENERAL] Questions about horizontal partitioning

2007-01-24 Thread David Lee Lambert
Ron Johnson wrote: On 01/08/07 20:39, Tom Lane wrote: John Sales <[EMAIL PROTECTED]> writes: By doing this, I'm hoping that the query optimizer is smart enough to see that if a query comes in and requests only the six columns (that are in the narrower ta

Re: [GENERAL] Cannot Restart PostgreSQL-8.1.4

2007-01-24 Thread Chad Wagner
On 1/24/07, Rich Shepard <[EMAIL PROTECTED]> wrote: libpq.so.3 => /usr/lib/libpq.so.3 (0xb7f5f000) So it's finding all the libraries it wants, and it's using the older libpq.so. Interesting. Where is your other installation of PostgreSQL installed? I suspect this is because somewhe

[GENERAL] NETEZZA cursors, anyone?

2007-01-24 Thread [EMAIL PROTECTED]
Greetings, How can we use cursors in NETEZZA? Can anyone please show me a simple example here. I am asking about netezza because it runs on postgresql. and I cant find any NETEZZA group here. Any help would be appreciated TIA ---(end of broadcast)---

[GENERAL] NETEZZA cursors, anyone?

2007-01-24 Thread [EMAIL PROTECTED]
Greetings, How can we use cursors in NETEZZA? Can anyone please show me a simple example here. I am asking about netezza is because it uses postgresql. and I cant find any NETEZZA group here. Any help would be appreciated TIA ---(end of broadcast)---

[GENERAL] Converting 7.x to 8.x

2007-01-24 Thread Carlos
What would be the faster way to convert a 7.4.x database into an 8.x database? A dump of the database takes over 20 hours so we want to convert the database without having to do a dump and resptore.

[GENERAL] Problem with replace

2007-01-24 Thread slawosz
Hello, I have to relpace string http://example.com/index.php?module=articles&id= to string /module/ in whole column in table. How exacly use replace? I noob in postgres, I think it could be quite easy. Please, help ---(end of broadcast)--- TIP 5: do

[GENERAL] Installing PostgreSQL under Cpanel

2007-01-24 Thread erick . papa
There are a couple of PostgreSQL tutorials around the web. I have followed them. Downloaded the *.rpm files and installed them. Then gone into my WHM (https://myserver:2087) and enabled the config, and set up the postgres user with an "su" command "adduser postgres". Now what? 1. Where's the inte

Re: [GENERAL] plpythonu array parameter

2007-01-24 Thread _
Anyone interested in arrays and plpython might find this interesting. Based on the conversation below I put these functions in a library (pg_stuff.py): def arr2list(a): a = a.replace("{","[").replace("}","]") pylist = eval(a) return pylist def list2arr(a): parm = `a` parm=parm

[GENERAL] Postgres processes have a burst of CPU usage

2007-01-24 Thread Subramaniam Aiylam
Hello all, I have a setup in which four client machines access a Postgres database (8.1.1) (on a Linux box). So, there are connections from each machine to the database; hence, the Linux box has about 2 postgres processes associated with each machine. I am using the JDBC driver (postgresql-8.

Re: [GENERAL] Cannot Restart PostgreSQL-8.1.4

2007-01-24 Thread Rich Shepard
On Wed, 24 Jan 2007, Martijn van Oosterhout wrote: Method 1: Find the .so module that perl uses (try locate Pg.so and ldd that). Martijn, Thank you for teaching me a new trick today. The results of method 1 are: /lib/libsafe.so.2 (0xb7f76000) linux-gate.so.1 => (0xe000

Re: [GENERAL] Idle in transaction - Explination ..

2007-01-24 Thread Uwe C. Schroeder
Well, in very short terms: a "idle" transaction is not committed. This means, when it's a writing transaction, that in the best case you have one or more row locks blocking access to the updated/inserted rows and in the worst case one or more table locks, which will block access to a table compl

Re: [GENERAL] Idle in transaction - Explination ..

2007-01-24 Thread David Fetter
On Wed, Jan 24, 2007 at 01:15:43PM -0800, Weslee Bilodeau wrote: > Where I work I'm in charge of more then a few PostgreSQL databases. > > I understand why idle in transaction is bad, however I have some > developers who I'm having a real difficult time fully explaining to them > why its bad. It'

Re: [GENERAL] Cannot Restart PostgreSQL-8.1.4

2007-01-24 Thread Martijn van Oosterhout
On Wed, Jan 24, 2007 at 01:08:04PM -0800, Rich Shepard wrote: > >The server doesn't care, what matter is what version the *client* (in this > >case SQL-Ledger) expects. ldd should tell you that. > > Martijn, > > OK. I'll go back there (which is where I started this journey). I don't > know how

Re: [GENERAL] Cannot Restart PostgreSQL-8.1.4

2007-01-24 Thread Alan Hodgson
On Wednesday 24 January 2007 13:08, Rich Shepard <[EMAIL PROTECTED]> wrote: >OK. I'll go back there (which is where I started this journey). I > don't know how to run ldd on a perl script. It'll be whatever version the DBD::Pg module is compiled to use. Just rebuilding and installing an upd

Re: [GENERAL] Stats collector frozen?

2007-01-24 Thread Jeremy Haile
Searching the archives, I found a couple of 2006 posts that seem somewhat related to my problem (although I don't see any solutions listed...): http://archives.postgresql.org/pgsql-hackers/2006-09/msg00415.php http://archives.postgresql.org/pgsql-hackers/2006-04/msg00127.php Tom, since you were in

Re: [GENERAL] Installing PostgreSQL under Cpanel

2007-01-24 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-01-23 23:17:31 +0800: > >Please don't top-post, it disturbes the flow of the communication. > > Interesting. I prefer getting to the point an author is making. Top posting means you end up far off the mark. > >There's documentation about that too, at the end of the in

[GENERAL] Idle in transaction - Explination ..

2007-01-24 Thread Weslee Bilodeau
Where I work I'm in charge of more then a few PostgreSQL databases. I understand why idle in transaction is bad, however I have some developers who I'm having a real difficult time fully explaining to them why its bad. Oh, and by bad I mean they have transactions that are sitting idle for 6+ hour

Re: [GENERAL] Cannot Restart PostgreSQL-8.1.4

2007-01-24 Thread Rich Shepard
On Wed, 24 Jan 2007, Martijn van Oosterhout wrote: What version of libpq.so do I need? The server doesn't care, what matter is what version the *client* (in this case SQL-Ledger) expects. ldd should tell you that. Martijn, OK. I'll go back there (which is where I started this journey).

Re: [GENERAL] capacity of tables

2007-01-24 Thread marcelo Cortez
People In my experience work very well con tables with 172.000.000 of records ( 172 millions). In fact is not too large number of records for postgresql. important aspect of this installation is your .conf file, take care of this, check old email with config subject. Best regards mdc --- R

Re: [GENERAL] Example of RETURNING clause to get auto-generated keys from INSERT

2007-01-24 Thread Bruno Wolff III
On Tue, Jan 23, 2007 at 23:19:47 -0600, Adam Rich <[EMAIL PROTECTED]> wrote: > > And your normal query would be this: > > INSERT into mytable (id,value) values (1,"foo"),(2,"bar"); > > Your new query would be like this: > > INSERT into mytable (id,value) values (1,"foo"),(2,"bar") > RETURNING

Re: [GENERAL] Installing PostgreSQL under Cpanel

2007-01-24 Thread Bruno Wolff III
On Wed, Jan 24, 2007 at 02:17:53 +0800, Erick Papadakis <[EMAIL PROTECTED]> wrote: > > I was just looking at the ident/trust/etc authentication banter from > pgsql docs. Couldn't make out what greek was on there. When I jostled > a bit, and finally understood it, and really wanted to write it in

Re: [GENERAL] Cannot Restart PostgreSQL-8.1.4

2007-01-24 Thread Martijn van Oosterhout
On Wed, Jan 24, 2007 at 12:02:30PM -0800, Rich Shepard wrote: > I got postmaster running now, but have been blocked by Bug #2701 when I > try to run SQL-Ledger. Google has 1,830 hits for it, so I'm far from the > first. :-) > > I'm running -8.1.4 here. In /usr/lib/ I have: > What version

Re: [GENERAL] Cannot Restart PostgreSQL-8.1.4

2007-01-24 Thread Rich Shepard
On Wed, 24 Jan 2007, Tom Lane wrote: Have you looked in the postmaster log? Tom, et al.: I got postmaster running now, but have been blocked by Bug #2701 when I try to run SQL-Ledger. Google has 1,830 hits for it, so I'm far from the first. :-) I'm running -8.1.4 here. In /usr/lib/ I hav

Re: [GENERAL] Cannot Restart PostgreSQL-8.1.4 -- SOLVED!

2007-01-24 Thread Rich Shepard
On Wed, 24 Jan 2007, Tom Lane wrote: Have you looked in the postmaster log? Tom, I went looking for it before writing, but did not find it. Now I have. The ownership and permissions of /var/lib/pgsql and /var/lib/postgresql were FUBAR. I changed the permissions and it's now running. Tha

Re: [GENERAL] capacity of tables

2007-01-24 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/24/07 13:06, guillermo arias wrote: > Hello, i am Guillermo Arias, from Peru. I have a doubt about > capacity of tables. I am developing a software for accountants, > and my principal problem is about the table for the vouchers. I > have to decid

Re: [GENERAL] Stats collector frozen?

2007-01-24 Thread Jeremy Haile
pgstat.stat was last updated 1/22 12:25pm - there is no pgstat.tmp. Coincidentally (I think not) - the last auto-analyze was performed at 2007-01-22 12:24:11.424-05. The logs for 1/22 are empty - so no errors or anything like that to give clues... Thanks! Jeremy Haile On Wed, 24 Jan 2007 14:

Re: [GENERAL] Cannot Restart PostgreSQL-8.1.4

2007-01-24 Thread Tom Lane
Rich Shepard <[EMAIL PROTECTED]> writes: > When I run '/etc/rc.d/rc.postgresql start' it returns 'Starting > PostgreSQL: ok', but '/etc/rc.d/rc.postgresql status' returns 'pg_ctl: > neither postmaster nor postgres running' which is true. Have you looked in the postmaster log? Under almost all

Re: [GENERAL] capacity of tables

2007-01-24 Thread Harald Armin Massa
One table. If you need to split, you can allways do that via inheritance & constraint exclusion, thereby creating table partitioning. Best wishes, Harald -- GHUM Harald Massa persuadere et programmare Harald Armin Massa Reinsburgstraße 202b 70197 Stuttgart 0173/9409607 fx 01212-5-13695179 - P

[GENERAL] capacity of tables

2007-01-24 Thread guillermo arias
Hello, i am Guillermo Arias, from Peru. I have a doubt about capacity of tables.I am developing a software for accountants, and my principal problem is about the table for the vouchers. I have to decide to make a table for each year or only one table for all the years. This table has 11 fields: var

Re: [GENERAL] Stats collector frozen?

2007-01-24 Thread Tom Lane
"Jeremy Haile" <[EMAIL PROTECTED]> writes: > The stats collector appears to still be running, since I can see a > postgres.exe process with -forkcol. However, I never notice it using > I/O or CPU usage. Also, querying the pg_stat_user_tables view shows no > change in table stats even for tables t

[GENERAL] Cannot Restart PostgreSQL-8.1.4

2007-01-24 Thread Rich Shepard
I had a problem with SQL-Ledger running on the local httpd that traced back to some crufty old libpg.so* from 2003 and 2004 in /usr/local/lib. I removed those (saved them, actually), ran ldconfig, then restarted both httpd and postgresql. Unfortunately, the latter really has not started despite

[GENERAL] Stats collector frozen?

2007-01-24 Thread Jeremy Haile
I've noticed that my tables are not being auto vacuumed or analyzed regularly, even though I have very aggressive autovacuum settings. The stats collector appears to still be running, since I can see a postgres.exe process with -forkcol. However, I never notice it using I/O or CPU usage. Also,

Re: [GENERAL] missing cache data for cache id 27

2007-01-24 Thread brian
Tom Lane wrote: brian <[EMAIL PROTECTED]> writes: Tom Lane wrote: Need a newer phpPGAdmin, perhaps? It'd be unsurprising for pre-8.1 code to fail to notice the OUT parameters, since it'd not know about the new columns in pg_proc ... phpPgAdmin 4.0.1 (4.1 is latest). But i was under the

Re: [GENERAL] missing cache data for cache id 27

2007-01-24 Thread Tom Lane
brian <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> Need a newer phpPGAdmin, perhaps? It'd be unsurprising for pre-8.1 code >> to fail to notice the OUT parameters, since it'd not know about the new >> columns in pg_proc ... > phpPgAdmin 4.0.1 (4.1 is latest). But i was under the impression th

Re: [GENERAL] missing cache data for cache id 27

2007-01-24 Thread brian
Tom Lane wrote: brian <[EMAIL PROTECTED]> writes: I'm getting the above error when i try to replace a function of mine. In what PG version? http://archives.postgresql.org/pgsql-bugs/2006-10/msg00044.php http://archives.postgresql.org/pgsql-committers/2006-10/msg00084.php And why does the f

Re: [GENERAL] missing cache data for cache id 27

2007-01-24 Thread Tom Lane
brian <[EMAIL PROTECTED]> writes: > I'm getting the above error when i try to replace a function of mine. In what PG version? http://archives.postgresql.org/pgsql-bugs/2006-10/msg00044.php http://archives.postgresql.org/pgsql-committers/2006-10/msg00084.php > And why does the function definition

Re: [GENERAL] missing cache data for cache id 27

2007-01-24 Thread brian
Richard Huxton wrote: brian wrote: I'm getting the above error when i try to replace a function of mine. It seems i have two problems: the latest dump (through phpPGAdmin) works fine, except that a function that should return a record was replaced without the column definition list, so calls

Re: [GENERAL] missing cache data for cache id 27

2007-01-24 Thread Richard Huxton
brian wrote: I'm getting the above error when i try to replace a function of mine. It seems i have two problems: the latest dump (through phpPGAdmin) works fine, except that a function that should return a record was replaced without the column definition list, so calls on it are failing. fro

[GENERAL] missing cache data for cache id 27

2007-01-24 Thread brian
I'm getting the above error when i try to replace a function of mine. It seems i have two problems: the latest dump (through phpPGAdmin) works fine, except that a function that should return a record was replaced without the column definition list, so calls on it are failing. from pg_dump: CRE

Re: [GENERAL] how to read bytea field

2007-01-24 Thread Richard Huxton
marcelo Cortez wrote: Richard H i'm understood now!, sorry for the noise. The thing to remember is it's encode/decode from the point of view of the bytea type. So hex/escape are encodings of the "real" value. -- Richard Huxton Archonet Ltd ---(end of broa

Re: [GENERAL] how to read bytea field

2007-01-24 Thread marcelo Cortez
Richard H i'm understood now!, sorry for the noise. thanks very, very much best regards mdc --- Richard Huxton escribió: > marcelo Cortez wrote: > > ok my mistake , > > > > insert into pblfield( id_ , value_field ) > >values(1 ,encode(E'\\000\\001', 'escape') > ::bytea > > )

Re: [GENERAL] how to read bytea field

2007-01-24 Thread Richard Huxton
marcelo Cortez wrote: ok my mistake , insert into pblfield( id_ , value_field ) values(1 ,encode(E'\\000\\001', 'escape') ::bytea ) ; No. Use "decode" to convert text to bytea, and "encode" to convert bytea to text. => CREATE TABLE tb (b bytea); CREATE TABLE richardh=> INSERT INTO tb

Re: [GENERAL] how to read bytea field

2007-01-24 Thread marcelo Cortez
ok my mistake , insert into pblfield( id_ , value_field ) values(1 ,encode(E'\\000\\001', 'escape') ::bytea ) ; best regards mdc __ Preguntá. Respondé. Descubrí. Todo lo que querías saber, y lo q

Re: [GENERAL] how to read bytea field

2007-01-24 Thread Richard Huxton
marcelo Cortez wrote: folks my table CREATE TABLE pblfield ( id_ integer NOT NULL, value_field bytea, name character varying(128), osset integer, length integer, version_ integer, inst_class_ character varying(128), CONSTRAINT pblfield_pkey PRIMARY KEY (id_) ) insert in

Re: [GENERAL] how to read bytea field

2007-01-24 Thread marcelo Cortez
folks my table CREATE TABLE pblfield ( id_ integer NOT NULL, value_field bytea, name character varying(128), osset integer, length integer, version_ integer, inst_class_ character varying(128), CONSTRAINT pblfield_pkey PRIMARY KEY (id_) ) insert into pblfield( id_ , value_f

Re: [GENERAL] how to read bytea field

2007-01-24 Thread Markus Schiltknecht
Hi, marcelo Cortez wrote: Are you sure you tested with a real bytea field? Yeah , i store bytea using encode function , how you say . I never said 'use encode function to store bytea'. I tried to explain that encode returns TEXT. The field of my table is bytea type , and store real by

Re: [GENERAL] how to read bytea field

2007-01-24 Thread Shoaib Mir
Decode works as expected for me Try the following: select decode((encode(E'\\000\\001', 'escape')::text), 'escape'); --- Shoaib Mir EnterpriseDB (www.enterprisedb.com) On 1/24/07, marcelo Cortez <[EMAIL PROTECTED]> wrote: hi Markus ,folks > Are you sure you tested with a real

Re: [GENERAL] how to read bytea field

2007-01-24 Thread Richard Huxton
marcelo Cortez wrote: Are you sure you tested with a real bytea field? Yeah , i store bytea using encode function , how you say . No, you store using the decode function. => \df decode List of functions Schema | Name | Result data type | Argument data types ---

Re: [GENERAL] how to read bytea field

2007-01-24 Thread marcelo Cortez
hi Markus ,folks > Are you sure you tested with a real bytea field? Yeah , i store bytea using encode function , how you say . The field of my table is bytea type , and store real bytea data in this field. My problem is , i can't convert this field to text anymore, not function receiving

Re: [GENERAL] how to read bytea field

2007-01-24 Thread Markus Schiltknecht
Hi, marcelo Cortez wrote: Yes i know, but if your define bytea field and store bytea in this field , decode don't work, Sure it does: test=# select encode(E'\\000\\001', 'escape')::text; encode -- \000\x01 (1 row) If you inspect the function, you'll find that encode can *only

Re: [GENERAL] how to read bytea field

2007-01-24 Thread marcelo Cortez
Shoaib ,folks Yes i know, but if your define bytea field and store bytea in this field , decode don't work, because decode function has text parameter not bytea ,so how do that to read bytea field to text again? what function convert bytea to text? best regards mdc --- Shoaib Mir <

Re: [GENERAL] Who is Slony Master/Slave + general questions.

2007-01-24 Thread Bernd Helmle
On Sat, 20 Jan 2007 11:07:57 +0500, "Shoaib Mir" <[EMAIL PROTECTED]> wrote: > I dont have the replication setup on my machine right now but I guess as > far > as I remember you can surely check for the master and slave nodes from a > Slony schema table. > I think the notion of "master and slave

Re: [GENERAL] copy schema X to schema Y in the same DB

2007-01-24 Thread Shoaib Mir
I think the way of doing that will be taking a schema backup using pg_dump -n option and then restoring that again in the same database using a different schema name with psql. Shoaib Mir EnterpriseDB (www.enterprisedb.com) On 1/24/07, johnf <[EMAIL PROTECTED]> wrote: Hi, I wo

Re: [GENERAL] how to read bytea field

2007-01-24 Thread Shoaib Mir
This might help you: select encode(col1,'escape') from tblBytea; where col1 is of type bytea... - Shoaib Mir EnterpriseDB (www.enterprisedb.com) On 1/24/07, marcelo Cortez <[EMAIL PROTECTED]> wrote: folks help me ,i cant read bytea type field's. how to convert bytea to text or

Re: [GENERAL] [1/2 OFF] Varlena.com inaccessible from .br (Blocked?)

2007-01-24 Thread Clodoaldo
2007/1/23, Alvaro Herrera <[EMAIL PROTECTED]>: Jorge Godoy wrote: > elein <[EMAIL PROTECTED]> writes: > > > Is there still a problem here? Does anyone know what the > > problem was? I have no trouble accessing varlena.com, > > but I am not a good tester for that. > > > > I was out of town durin

Re: [GENERAL] Numeric to integer Type conversion

2007-01-24 Thread A. Kretschmer
am Tue, dem 23.01.2007, um 23:47:08 -0800 mailte Saravanan Bellan folgendes: > We have database table with the following columns, > > foo > -- > name VARCHAR(20) > bar NUMERIC(20,0) > > We were running version 7.2.1 until now. > > The following SQL used to work fine in 7

[GENERAL] Numeric to integer Type conversion

2007-01-24 Thread Saravanan Bellan
We have database table with the following columns, foo -- name VARCHAR(20) bar NUMERIC(20,0) We were running version 7.2.1 until now. The following SQL used to work fine in 7.2.1, SELECT name FROM foo WHERE (bar & 64) <> 0; Now we upgraded to version 8.1.5 and getting