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_
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
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
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
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
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
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'-
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
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
[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
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
+--+--+---+
|
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:
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
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
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
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
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
"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
>
"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
>
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
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
"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)
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
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
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
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
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]
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]
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
ansactions like PostgreSQL?
Tom Lane wrote:
> Jose Soares <[EMAIL PROTECTED]> writes:
> > ---
> > Interbase, Oracle,Informix,Solid,Ms-Access,DB2:
> > ---
> >
>
> - 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]
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]
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]
; > 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]
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]>
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
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
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
> >
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
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:
>
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
> ...
>
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
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
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
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
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'
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
47 matches
Mail list logo