[GENERAL] database design best pratice help

2013-01-28 Thread Jose Soares
Hi all, I have a question about database design best pratice. In my db I have about one hundred tables like this: code description To avoid to have a so great number of similar tables in the db I wonder if it is a good idea to unify all these tables in one big table like this: id code table_

Re: [GENERAL] dump order by

2012-12-24 Thread Jose Soares
I'm sorry my first example was incomplete I need to migrate data from postgresql to oracle thus I have to use dump --column-inserts instead of copy to have an output like this but order by pk: INSERT INTO test (id, note, id_father) VALUES (6, 'Homer Simpson ', 5); INSERT INTO test (id, note, id_f

Re: [GENERAL] Re: "don't know how to print type 715"

1998-09-21 Thread Jose' Soares
Carilda A. Thomas wrote: > > Since I have now seen two other people complain about this, I will join > the fray. > > I am running Solaris 2.6, Postgresql v6.3.2. > I have also gotten the same notice on FreeBSD 2.1. but not the threaded one -- this was for a client a while back) running > v6.3.1

Re: [GENERAL] float8 to text converter

1998-11-03 Thread Jose' Soares
Hi Memphisto, If you are using v6.4 you can use CAST as: prova=> select cast('1.7976931348623e+308'::float8 as text); ?column? 1.7976931348623e+308 (1 row) or: prova=> select cast(f as text) from a; text -- 4714-11--2147483624 BC <--- 4714-11--2147483

Re: [GENERAL] Transaction aborted?

1998-11-03 Thread Jose&#x27; Soares
Mike Meyer wrote: > > I'm seeing these messages in the process of adding entries to a > database. > > NOTICE: (transaction aborted): queries ignored until END > > I'm not positive what they mean. Is there someone who is who could > tell me, and tell me how to catch then and deal with t

Re: [GENERAL] select using date

1999-01-08 Thread Jose&#x27; Soares
Try: select current_date, CURRENT_DATE - INTERVAL '1 DAY'; ?column?|?column? --+-- 1999-01-08|1999-01-07 00:00:00+01 (1 row) PostgreSQL has a syntax sligth different than SQL92. You have to enclose '1 DAY' instead of '1' DAY. -Jose'- Kevin Heflin wrote: > > Tryi

Re: [GENERAL] Representation of big integer numbers.

1999-01-18 Thread Jose&#x27; Soares
Memphisto wrote: > > Hi, > > Is there a way to display big integer numbers splitted by periods in > PostgreSQL queries? > > Example: 123.456.789 instead of 123456789 . > > Thanks in advance You can create a function to format numbers. See attached example. -Jose'-

Re: [GENERAL] Newbie interface question

1999-01-22 Thread Jose&#x27; Soares
Dan Warren ha scritto: > You'll have to forgive me if this is a trivial question but I'm *very* > new to this. I'm developing an online time clock program and was > wondering if there was a character based front end, similar to Oracle's > SQL*Forms, that could be used for a postgres 6.4.2 data

Re: [GENERAL] A mistake generates strange result

1999-02-12 Thread jose&#x27; soares
  Stéphane Dupille ha scritto:     Hi ! "Ricardo J.C.Coelho" <[EMAIL PROTECTED]> writes: > Just for PgSQL's development group think about > I made a mistake typing a query that generates a strange result > (Very strange). > The query: select text('12345678'::float8); > It returns a date i

Re: [GENERAL] timestamps

1999-02-24 Thread jose&#x27; soares
[EMAIL PROTECTED] ha scritto: > I'm trying to create a column that defaults to the current time and date. I > tried the SQLServer like syntax below but potgresql choked: > > CREATE TABLE clicks ( > avo_userid varchar (10) NOT NULL , > link_id int NOT NULL , > the_time timestamp NOT

Re: [GENERAL] Comments on tables, functions, etc.

1999-02-26 Thread jose&#x27; soares
  Michael Davis ha scritto: How can I add a comment to a table, function, etc. that will should up in a /dd comment in psql? pg_description has two fields... joe=> \d pg_description Table    = pg_description +--+--+---+ |

[GENERAL] Re: NOTICE: _outNode: don't know how to print type 715

1998-09-17 Thread Jose&#x27; Soares
Hi all, PostgreSQL gives me a strange message when I try to create a table with a NOT NULL column. drop table prova; DROP create table prova( campo1 INTEGER ); CREATE drop table prova; DROP create table prova( campo1 INTEGER NOT NULL ); NOTICE:

Re: [GENERAL] ODBC-client->Linux-server: datatype boolean not recognized?

1999-10-01 Thread jose soares
oh! this was for old releases, now I'm using the following: create function MsBool(bool,int4) returns bool as ' declare     bool_int int4; begin     if $1 is NULL then     return NULL;     end if;     if $1 is TRUE then if $2 <> 0 then ret

Re: [GENERAL] update view

1999-11-29 Thread jose soares
You must create a rule to make a view updatable as in the following example:   drop table emp; create table emp (     empno    int,     ename   char(20),     job  char(12),     hiredate date,     sal  money,     comm int,     deptno   int,     level   

Re: [GENERAL] Date & Time

1999-12-01 Thread jose soares
Ed Loehr ha scritto: > Just curious: anyone have any comment on any practical differences between now() >and CURRENT_TIMESTAMP, which seems to work > the same? > I think it is the same function, both of them return the current date and time. now() should be the internal postgreSQL function. a

Re: [GENERAL] How to stop implicit rollback on certain errors?

1999-12-09 Thread Jose Soares
Peter Eisentraut wrote: > On 1999-12-08, Lincoln Yeoh mentioned: > > > begin; > > insert into stuff; > > do some nondatabase things based on last inserted id; > > update a date in stuff; > > commit; > > > > It seems that if the date is out of the database range, everything is > > thrown out. Is i

Re: [GENERAL] Where is IFNULL?

1999-12-09 Thread Jose Soares
select * from a; a|b -+- 1|primo 2| (2 rows)   SELECT CASE WHEN b IS NOT NULL THEN 'pref.'||b||'.suf' ELSE 'pref.'||'NULL'||'.suf' END FROM a; case -- pref.primo.suf pref.NULL.suf (2 rows)   Jose' Sascha Ziemann wrote: "Gene Selkov Jr." <[EMAIL PROTECTED]>: | > the user manual des

Re: [GENERAL] How to stop implicit rollback on certain errors?

1999-12-13 Thread Jose Soares
"Ross J. Reedstrom" wrote: > > Hmm, sounds like a vote for nested transactions. The JDBC driver developer > (Peter Mount) was musing that nested transaction would make large object > support easier for him, as well. > > As to the other example of Oracle not forcing a rollback, I have a feeling >

Re: [GENERAL] How to stop implicit rollback on certain errors?

1999-12-13 Thread Jose Soares
"Ross J. Reedstrom" wrote: > > Hmm, sounds like a vote for nested transactions. The JDBC driver developer > (Peter Mount) was musing that nested transaction would make large object > support easier for him, as well. > > As to the other example of Oracle not forcing a rollback, I have a feeling >

[GENERAL] Re: [HACKERS] \copy problem

1999-12-17 Thread Jose Soares
wrote: > > On 1999-12-16, Jose Soares mentioned: > > > I have a problem using \copy to load data into tables. > > > > I have to load data into a table that contains data type fields with > > NULL values. > > I tried using \N but it doesn't work. > &g

Re: [GENERAL] Import table from MS Access?

2000-01-05 Thread Jose Soares
I have some troubles to access PostgreSQL tables linked to M$-Access2000. Does anyone have any ideas, how to do that? Thanks. [EMAIL PROTECTED] wrote: > We've had good luck with something we found at: > > http://www.sevainc.com/ > > David Boerwinkle > > -Original Message- > From: Mike

Re: [GENERAL] How to get number of the week from datetime?

2000-01-14 Thread Jose Soares
"Hojdar Karel Ing." wrote: > Hi, > > how I can get some agregates (avg, min, max) for whole week (in specified > year)? > For example from table with two columns : time datetime and value float8. > And I want to get average of value based on whole weeks. If I try to use > date_part('week',time)

Re: [GENERAL] max(oid)

2000-01-24 Thread Jose Soares
Peter Eisentraut wrote: > On 2000-01-21, Bruce Momjian mentioned: > > > > Is there a way to use the max aggregate on an oid field? When I try on > > > 6.5.3, I get the following error message: > > > > > > test=> select max(uid) from user_base; > > > ERROR: Unable to select an aggregate function

Re: [GENERAL] Can || be used in ORDER BY?

2000-01-26 Thread Jose Soares
create table tablename ( field1 text, field2 text); CREATE insert into tablename values('bottom','yes'); INSERT 2282464 1 insert into tablename values('top','no'); INSERT 2282465 1 select field1,field2 from tablename order by (field1||'-top'); field1|field2 --+-- bottom|yes top   |no (2 r

Re: [GENERAL] what is "view?"

2000-01-26 Thread Jose Soares
A view is a table with a rule SELECT For excample if you have a table named my_table and you create a rule like: CREATE RULE "_RETmy_table" AS ON SELECT TO "my_table" DO INSTEAD SELECT * FROM your_table; In this way you your table my_table became a view. José Marc Tardif wrote: > When lis

Re: [GENERAL] Bug with indexing int4?

2000-01-20 Thread Jose Soares
  Yury Don wrote: Hello All, I ma sorry, I have sent previous uncomplited e-mail accidentally. I have created the table CREATE TABLE "tt" (     "cc" int4); COPY "tt" FROM stdin; -2112563299 -2111287024 -2110307960 . 2146589610 2146589611 2146589612 \. About 30 000 records totally Then I a

Re: [GENERAL] Need help creating a function

2000-02-04 Thread Jose Soares
txt); return m; end; ' language 'plpgsql'; Hitesh Patel wrote: > Does anyone have a function laying around that convert a 'money' type to > a float8 and return it? > > -- Jose' Soares Bologna, Italy [EMAIL PROTECTED]

[GENERAL] TRANSACTIONS

2000-02-22 Thread Jose Soares
s and who is in the rigth path PostgreSQL or the others, considering the two examples reported below. Comments? -- Jose' Soares Bologna, Italy [EMAIL PROTECTED]

[GENERAL] Re: [HACKERS] TRANSACTIONS

2000-02-23 Thread Jose Soares
Dmitry Samersoff wrote: > On 22-Feb-2000 Jose Soares wrote: > > begin transaction; > > create table tmp(a int); > > insert into tmp values (1); > > insert into tmp values (10); > > ERROR: pg_atoi: error reading &q

Re: [GENERAL] Re: [HACKERS] TRANSACTIONS

2000-02-23 Thread Jose Soares
ansactions like PostgreSQL? Tom Lane wrote: > Jose Soares <[EMAIL PROTECTED]> writes: > > --- > > Interbase, Oracle,Informix,Solid,Ms-Access,DB2: > > --- > >

[GENERAL] Re: [HACKERS] TRANSACTIONS

2000-02-23 Thread Jose Soares
> > - Don Baccus, Portland OR <[EMAIL PROTECTED]> > Nature photos, on-line guides, Pacific Northwest > Rare Bird Alert Service and other goodies at > http://donb.photo.net. > > -- Jose' Soares Bologna, Italy [EMAIL PROTECTED]

Re: [GENERAL] Date problem

2000-03-13 Thread Jose Soares
ntation about how to do this, and the closest thing to an answer came from this newsgroup. No luck so far tho' does anyone know how to do this and possibly and source of good documentation on this type of thing. Regards Scott McDaid edNET t: +44 131 625 5557 (direct dial) t: +44 131 466 7003 (office) -- Jose' Soares Bologna, Italy [EMAIL PROTECTED]  

Re: [GENERAL] Max Length for VARCHAR?

2000-03-13 Thread Jose Soares
need a datatype that can hold very > large text? > > Chris > > -- > Christopher D. Gokey, Raytheon ITSS, NASA/GCMD > 18 Martin Road, Shelburne Falls, MA 01370 > Phone: Voice (413) 625-8129 / FAX 208-248-9055 > [EMAIL PROTECTED] / http://gcmd.nasa.gov -- Jose' Soares Bologna, Italy [EMAIL PROTECTED]

Re: [GENERAL] alter table

2000-03-13 Thread Jose Soares
; > select * from tmp where last='two' > > > > >ERROR: RestrictionClauseSensitivity: bad value -1.998613 > > > > i tried to search the mailing lists but i couldn't find anything > > > > any ideas? > > It's working here with version 6.5.3. Which version are you using? > > Wim -- Jose' Soares Bologna, Italy [EMAIL PROTECTED]

Re: [GENERAL] How to retrieve table definition in SQL

2000-03-21 Thread Jose Soares
does, which I assume you are referring to. The problem is that postgress doesn't echo anything for \commands only real SQL commands. If it works on yours could you copy the echoed query and forward it to me. Jeff Seese > From: Jose Soares <[EMAIL PROTECTED]>

[GENERAL] COALESCE() or NVL()

1998-06-12 Thread Jose&#x27; Soares Da Silva
Hi all, I'm looking for a function like COALESCE() or the Oracle NVL(), to returns a ZERO value instead of a NULL value. To have the result: NULL+1 = 1 instead of NULL+1 = NULL Have PostgreSQL something like this ? I tried to write it on C but I can't realize the beavior of NULLs, I can't get tha

Re: [GENERAL] extracting date information?

1998-05-19 Thread Jose&#x27; Soares Da Silva
On Mon, 18 May 1998, Kevin Heflin wrote: > Any hints or clues on this one? > Using Postgresql6.3 and PHP2 > > I have a simple database with a list of events, one of the fields is of > the data type "date". > > When I call this information from the database, it prints out the date > in the form

Re: [GENERAL] extracting date information?

1998-05-20 Thread Jose&#x27; Soares Da Silva
On Tue, 19 May 1998, Kevin Heflin wrote: > On Tue, 19 May 1998, Jose' Soares Da Silva wrote: > > > If you use "datetime" type instead of "date" and set datestyle = 'Postgres' > > your data will be like: Sat Dec 12 00:00:00 1998 CET > >

[GENERAL] error messages not only English

1998-05-22 Thread Jose&#x27; Soares Da Silva
Hi all, I see that PostgreSQL mainly gives error messages in English, I see also that in some cases there's the possibility to configure it to give messages in other languages like global.c that may be configured to give messages in German. MySQL gives the possibility to configure it using an ex

Re: [GENERAL] Privileges

1998-05-25 Thread Jose&#x27; Soares Da Silva
On Sun, 24 May 1998, The Hermit Hacker wrote: > That command did not return an error, rather it said CHANGE (without > the exclamation marks, of course). However, afterward, I was still able > to insert into the table. What gives? It works for me, I have v6.3 > > Also, another question: >

Re: [GENERAL] GRANT/REVOKE problems

1998-05-26 Thread Jose&#x27; Soares Da Silva
On Mon, 25 May 1998, Marin D wrote: Do you want revoke all previleges from postgres? Remember that user postgres is the super user. I think you don't do that. Jose' > > Hi! > > I cant make grant/revoke work... > > An example > > test=> \z > ... >

[GENERAL] PgAccess running on Win95 ?

1998-06-04 Thread Jose&#x27; Soares Da Silva
On Wed, 3 Jun 1998, Constantin Teodorescu wrote: > Jose' Soares Da Silva wrote: > > > > pgtcl.c:20: tcl.h: No such file or directory > > I really do not understand why it wouldn't compile the 6.3.2! > Be aware ! 6.3.2 has a little error in ./configure determin

[GENERAL] TRIGGERS

1998-06-04 Thread Jose&#x27; Soares Da Silva
Hi, all! I am trying to create a trigger to update a field on a "son" table when a linked field (foreign key) is modified on a table "father". example: table son: table father: - id /-< id description

Re: [GENERAL] Missing SQL Syntax & Problem with Create Table

1998-06-08 Thread Jose&#x27; Soares Da Silva
On Mon, 8 Jun 1998, Fredrick Meunier wrote: > Hi, > I have a database design tool under windows, and it has a > feature where you can store varoius metadata about your database > in an ODBC database. I would like to use PostgreSQL as the > repository. The product goes and creates it's own

Re: [GENERAL] Foreign Keys

1998-06-09 Thread Jose&#x27; Soares Da Silva
On Mon, 8 Jun 1998, ENTER YOU NAME HERE wrote: > Hi all > I am using PostgreSQL as part of my MSc project. Because it is an > object-relational database it is a superset of a pure relational and so > tried to add foreign keys but are not supported. How can I overcome this > problem? man create_tr

Re: [GENERAL] Setting the table separator in psql command mode

1998-06-09 Thread Jose&#x27; Soares Da Silva
On Tue, 9 Jun 1998, Mehrdad Ghassempoory wrote: > I am trying to set up the table separator (Default "|") to TAB > caharcter. > > I have tried : > > \f\t > \f \t > \f '\t' > > Without any luck. > How is it done? Try psql -F"" this mean ^I Jose'

Re: [GENERAL] Problem with apostrophe

1998-06-18 Thread Jose&#x27; Soares Da Silva
On Wed, 17 Jun 1998 [EMAIL PROTECTED] wrote: > Is there any way of having an apostrophe in a data field? > It is a problem because the apostrophe is the same character as the single > quote, so the database gets a parser error when a name such as "O'Brian" > is entered. > > There must be a work