On Tue, 9 Nov 2004, Ferindo Middleton, Jr wrote:
> Is it possible for an UPDATE/INSERT query string to function in such a way
> that it requires two like fields in different tables to be equal to/'in sync
> with' one another:
>
> Example: I have two tables: registration & schedules
> they both
On Tue, 9 Nov 2004, carex wrote:
> And it works also perfectly with Gentoo.
>
> So,is this a typical "Redhat Enterprise" problem ?
> Or do I overlook something ??
IIRC, in 7.3.x, index scans are only considered in "C" locale for
regexp/LIKE. In 7.4.x, non-"C" locale databases can use a special
i
On Fri, 12 Nov 2004, Thomas Berg wrote:
> Within a function (and therefore within a transaction), if I UPDATE the
> primary key of a table, the old value remains visible in the child table
> through the end of the function. Is this
8.0 runs immediate triggers after each statement of a function a
On Tue, 16 Nov 2004, Thomas F.O'Connell wrote:
> I am wondering whether the following two forms of SELECT statements are
> logically equivalent:
>
> SELECT COUNT( DISTINCT table.column ) ...
>
> and
>
> SELECT DISTINCT COUNT( * ) ...
Not in general.
The former counts how many distinct table.colu
On Tue, 16 Nov 2004, Thomas F.O'Connell wrote:
> Is there another way to accomplish what the former is doing, then?
The only thing I can think of is a subselect in from that uses distinct.
select count(*) from (select distinct ...) foo
That also theoretically allows you to use select distinct *
On Tue, 16 Nov 2004, Thomas F.O'Connell wrote:
> Hmm. I was more interested in using COUNT( * ) than DISTINCT *.
>
> I want a count of all rows, but I want to be able to specify which
> columns are distinct.
I'm now a bit confused about exactly what you're looking for in the end.
Can you give a s
On Fri, 19 Nov 2004, Don Drake wrote:
> On Fri, 19 Nov 2004 17:48:34 +, Richard Huxton <[EMAIL PROTECTED]> wrote:
> > Don Drake wrote:
> > > select 'some text, should be null:'|| NULL
> > >
> > > This returns NULL and no other text. Why is that? I wasn't expecting
> > > the "some text.." to
On Wed, 1 Dec 2004, Sandro Joel Eller wrote:
> I have a query using "like" operator (select * from name like 'JOHN%'),
> but the table has about 500 hundred records. The has a index (create
> index ixcontract_name on contract (name)) , but it is very slow because
> it is not using index. How do
On Fri, 10 Dec 2004, Wei Weng wrote:
> I have a table
>
> create table temp
> (
> tempdatetimestamp,
> tempnamevarchar(10)
> );
>
> And I tried to insert the following:
>
> insert into table temp (tempname, tempdate)
> select distinct 'tempname', null from some_other_re
On Sat, 11 Dec 2004, Ian Barwick wrote:
> (Oddly enough, putting the NULL in the CHECK constraint seems
> to make the constraint worthless:
> test=> create table consttest (field varchar(2) check (field in
> (null, 'a','b','c')));
> CREATE TABLE
> test=> insert into consttest values ('xx');
> INS
On Sat, 11 Dec 2004, Rod Taylor wrote:
> On Sat, 2004-12-11 at 07:47 -0800, Stephan Szabo wrote:
> > On Sat, 11 Dec 2004, Ian Barwick wrote:
> >
> > > (Oddly enough, putting the NULL in the CHECK constraint seems
> > > to make the constraint worthless:
> >
On Wed, 15 Dec 2004, Marian POPESCU wrote:
> Hi,
>
> I have a problem with this join query:
>
>
> SELECT
> CASE WHEN (UR.id_rights IS NULL) THEN '0' ELSE UR.id_rights END as
> id_rights,
> CASE WHEN (UR.r_category IS NULL) THEN 'CMP' ELSE UR.r_category END as
> category,
> U.id
On Tue, 4 Jan 2005, [iso-8859-2] BARTKO, Zoltán wrote:
> if I create the tables that are in the attached file, I can't insert
> rows into the AAttachment table, even though the rows in DObject with
> the given primary key exist (PgSQL 8.0 rc1 complains about
> (ownerid)=(insert the number here) n
On Wed, 5 Jan 2005, [iso-8859-2] BARTKO, Zoltán wrote:
> Ok, so I made some changes (manual "inheritance" of PK and FK
> constraints), but nevertheless I get still the same dumb error. I made
> a dump of the DB via pg_dump, it is available at
>
> http://de.geocities.com/bartkozo/dump.tgz
>
> DRec
On Wed, 5 Jan 2005, Stephan Szabo wrote:
>
> On Wed, 5 Jan 2005, [iso-8859-2] BARTKO, Zoltán wrote:
>
> > Ok, so I made some changes (manual "inheritance" of PK and FK
> > constraints), but nevertheless I get still the same dumb error. I made
> > a dump of t
On Tue, 11 Jan 2005, Terry Lee Tucker wrote:
> Hello:
>
> I'm trying to figure out how to convert a floating point value into an
> interval of time. I'm calculating the time required to drive from point A to
> point B. For the sake of this question, we'll just say it is miles/speed. So:
>
> drv_t
On Sat, 15 Jan 2005, Ari Kahn wrote:
> CREATE FUNCTION gets_nooky() returns numeric AS
> '
> DECLARE
> i integer;
> gt1cnt record;
> gt1 record;
> cluster record;
> cluster_cnt integer;
> slocus integer;
> minmax record;
>
> BEGIN
> SELECT INTO gt1 * FROM c
On Thu, 27 Jan 2005, Sandeep Gaikwad wrote:
> I can give foreign key relationship between two tables of same
> database. Can I give foreign key relationship between tables of two
> databases ? Plz, let me know if possible & send me how can I do that?
Unfortunately, that's not really current
On Sun, 30 Jan 2005, Don Drake wrote:
> OK, I have a function that finds records that changed in a set of
> tables and attempts to insert them into a data warehouse.
>
> There's a large outer loop of candidate rows and I inspect them to see
> if the values really changed before inserting.
>
> My
earch. You may
want to do some testing to see how it runs for you.
> On Mon, 31 Jan 2005 13:31:34 -0800 (PST), Stephan Szabo
> <[EMAIL PROTECTED]> wrote:
> >
> > On Sun, 30 Jan 2005, Don Drake wrote:
> >
> > > OK, I have a function that finds records that ch
On Wed, 9 Feb 2005, Ing. Jhon Carrillo wrote:
> Those instructions are good but i want to call this function only for "
> select consulta_contacto(1)" nothing more, Is really necesary to use
> "AS ..."?
If it absolutely needs to be setof record, yes.
It may be more appropriate to make a composi
On Fri, 18 Feb 2005, Bret Hughes wrote:
> I can't seem to find an explanation of what adding ONLY does for an sql
> statement for instance :
>
> ALTER TABLE [ONLY] ADD COLUMN ...
>
> or what ever. Does anyone have a pointer to docs on this. I am simply
> curious since there is obviously somethi
On Thu, 3 Mar 2005, Thomas Mueller wrote:
> Hi there,
>
> I have a simple database:
>
> CREATE TABLE pwd_description (
>id SERIALNOT NULL UNIQUE PRIMARY KEY,
>name varchar(50) NOT NULL
> );
>
> CREATE TABLE pwd_name (
>id SERIALNOT NULL UNIQUE PR
On Tue, 8 Mar 2005, Fatih Cerit wrote:
> I have a function and I want to update a table's two rows but having problem
> with plpgsql & date-time functions. First field of the table must be now()
> this is ok.. but the second field must be now() + '60 days' if the query
> like this : SELECT INTO to
On Thu, 17 Mar 2005, Leif B. Kristensen wrote:
> CREATE TABLE name_part_types ( -- a key/label pair
> name_part_type_id INTEGER PRIMARY KEY,
> name_part_type VARCHAR(50)
> );
>
>
> CREATE TABLE names ( -- one person can have multiple names
> name_id INTEGER PRIMARY KEY,
> person_i
On Fri, 18 Mar 2005, Kenneth Gonsalves wrote:
> On Thursday 17 Mar 2005 7:35 pm, Richard Huxton wrote:
>
> > Not necessarily. NOT NULL here helps to ensure you can add values
> > together without the risk of a null result. There are plenty of
> > "amount" columns that should be not-null (total spe
On Fri, 1 Apr 2005, Rosser Schwarz wrote:
> A colleague has the following query, which errors with: relation "dl"
> does not exist. (See the second item in the FROM clause.) If that
> item is moved to immediately precede the first JOIN item however, the
> query works as expected.
>
> select u.u
On Tue, 19 Apr 2005, sreejith s wrote:
> Hai friends,
> I have a field with data type 'Money' with my table. I select this
> field a select query and displays the same in a textbox. While doing
> this a dollar ($) is prefixed to the actual table value. How to avoid
> this symbol so as to display
On Fri, 29 Apr 2005, Michael M Friedel wrote:
> I am trying to use an application (Through ODBC) that uses the
> following update syntax
>
> UPDATE MyTable SET MyTable.id=2 WHERE id=1
>
> unfortunatly I get an error message
>
> ERROR: column "mytable" of relation "mytable" does not exist
>
> Ques
On Sun, 24 Apr 2005, tuan wrote:
> In sql server my division select cast(3 as float)/10 is 0.299.
> But in postgres select cast(3 as float8)/10 is 0.3. How to get result like
> sql server?
I believe you can control what precision is used in printing the float
results with extra_float_digi
On Fri, 29 Apr 2005, Tornroth, Phill wrote:
> I have many tables who's natural key includes a nullable column. In this
> cases it's a soft-delete or 'deprecated' date time. I'd like to add a
> table constraint enforcing this constraint without writing a custom
> procedure, but I've found that post
On Sat, 30 Apr 2005, Tornroth, Phill wrote:
> >I believe you can add partial unique indexes to cover the case where a
> >column is null, but if you have multiple nullable columns you need to
> >worry about you end up with a bunch of indexes.
>
> Hmmm. I hadn't thought of that, thanks. Yes, the ind
> Hi,
>
> I have a java app that uses hibernate to do queries.
>
> One query on a 6.5 millions records takes about 15 seconds while the
> same one (take from the sql that shows in the consol - I configured
> hibernate to show_sql) takes about 50 ms when done with pgadmin3.
We could answer better w
On Tue, 7 Jun 2005, M.D.G. Lange wrote:
> It is not possible to create a constraint Foreign key for "wordid". No
> problem there, but I want to be certain that a given wordid exists in
> tbldictionary.
> Would I have to create a "RULE" or a "TRIGGER" to be certain that the
> wordid is existing in
On Wed, 22 Jun 2005, Russell Simpkins wrote:
> Hello,
>
> I have created a trigger function to update the sort_order column of a
> mapping table. I have table a that has a many to many relation ship with
> table b that is mapped as a_b where a_id, and b_id are the pk columns and
> there is a sort
On Wed, 22 Jun 2005, Tom Lane wrote:
> Stephan Szabo <[EMAIL PROTECTED]> writes:
> >> CREATE TRIGGER u_test1 BEFORE DELETE ON portfolio.test1 FOR EACH ROW
> >> EXECUTE
> >> PROCEDURE resort_test1();
>
> > I think this will work in an after delete tr
On Wed, 10 Aug 2005 [EMAIL PROTECTED] wrote:
> I thought that the parenthesis in the table expression
> (FROM clause), could be used to indicate the desired
> evaluation order. But, I tried with a couple of samples
> and the explain command returned me the same result; no matter
> what parentheses
On Mon, 15 Aug 2005, Dario Bahena Tapia wrote:
> The final result seems to be the same, I just was curious about the
> standard behavior. Does the SQl says something about this execution
> order?
I believe SQL defines the order to pay attention to parens, so A join (B
join C) style clauses result
On Mon, 22 Aug 2005 [EMAIL PROTECTED] wrote:
> Hi all,
>
> I've written a stored procedure but am having trouble calling it.
>
> The procedure name is called "insert_period" and I am calling using:
>
> SELECT
> insert_period(1::INTEGER,'2005-09-13'::DATE,'2005-09-15'::DATE,'unavailable_periods');
On Mon, 22 Aug 2005, Lane Van Ingen wrote:
> Hi, am trying to do a simple computation on two views, but for some reason
> the current_util_in computation always returns zero. All fields being used
> are integer.
>
> select a.if_id,
> a.in_count,
> a.time_incr,
> b.speed,
> ((a.t
On Sat, 3 Sep 2005, Robert D. Kennedy wrote:
> I have seen in another thread that sub-queries in a CHECK
> constraint have implementation ramifications that make them awkward to
> implement and support. OK, fair enough, c'est la vie.
>
> ERROR: cannot use subquery in check constraint
>
> is
On Mon, 5 Sep 2005, Antony Sohal wrote:
> Please can you help me with the following trigger I have written in
> PostgreSQL 7.4.8 running under Fedora Linux, using pgAdmin III as
> client.
> Now I create a trigger on event table as :
>
> CREATE OR REPLACE FUNCTION fn_event()
> RETURNS "trigger"
On Fri, 2 Sep 2005, [ISO-8859-2] Graf L?szl? wrote:
>
>CREATE FUNCTION test_verif() RETURNS trigger AS $test_verif$
>BEGIN
>NEW.id := select nextval('test_azon_seq');
I think you want to remove select here, you're already effectively doing a
select of the right hand side
On Tue, 6 Sep 2005, Harald Fuchs wrote:
> In article <[EMAIL PROTECTED]>,
> Stephan Szabo <[EMAIL PROTECTED]> writes:
>
> > On Fri, 2 Sep 2005, [ISO-8859-2] Graf László wrote:
>
> >>
> >> CREATE FUNCTION test_verif() RETURNS trigger AS $test
On Fri, 16 Sep 2005, Kenneth Dombrowski wrote:
> I can't get this one to work at all:
>
> create or replace function update_rate (integer, integer, integer,
> integer, numeric, integer)
> returns void
> as '
> declare
> x_admin_id alias for $1;
>
On Wed, 5 Oct 2005, Leif B. Kristensen wrote:
> I'm a little confused about partial indexes. I have a couple of tables,
> like this:
>
> CREATE TABLE events (
> event_idINTEGER PRIMARY KEY,
> tag_type_fk INTEGER REFERENCES tag_types (tag_type_id),
> place_fkINTEGER REFERENCES
On Tue, 11 Oct 2005, Rick Schumeyer wrote:
> I'm not sure what I was thinking, but I tried the following query in pg:
>
> SELECT * FROM t GROUP BY state;
>
> pg returns an error.
>
> Mysql, OTOH, returns the first row for each state. (The first row with
> "AK", the first row with "PA", etc.)
>
>
On Wed, 19 Oct 2005, [iso-8859-2] Havasv?lgyi Ott? wrote:
> Hi,
>
> I have just run this command on 8.0.4 :
>
> SELECT 'foo' WHERE 0 NOT IN (NULL, 1);
>
> And it resulted is zero rows.
> Without NULL it is OK.
> Is this a bug, or the standard has such a rule?
This is standard behavior.
Seeing if
On Wed, 26 Oct 2005, Mario Splivalo wrote:
> Consider this function:
>
> CREATE OR REPLACE FUNCTION php_get_subfield_data_repeating(int4,
> "varchar")
> RETURNS SETOF "varchar" AS
> $BODY$
> DECLARE
> aRecordID ALIAS FOR $1;
> aSubFieldId ALIAS FOR $2;
>
> returnValue record;
>
On Sun, 13 Nov 2005, Steve SAUTETNER wrote:
> Hi,
>
> I have a table named "famille" whose structure and content is :
>
> famille_code | famille_mere_famille_code | famille_libelle |
> famille_niveau
> --+---+---+-
> ---
> 00
On Tue, 22 Nov 2005, Luca Pireddu wrote:
> I wrote a little function that has to work with big numbers
>
> CREATE OR REPLACE FUNCTION blast_evalue(seq_len bigint, db_size bigint,
> bit_score double precision)
> RETURNS double precision AS $$
> BEGIN
> RETURN 2^(bit_score) * db_size * seq_len;
On Sun, 4 Dec 2005, Joost Kraaijeveld wrote:
> Hi,
>
> I want the number of customers that have a zipCode smaller tha a given
> value. The foolowing query doe snot work : I get an error (ERROR:
> column "addresses.zipcode" must appear in the GROUP BY clause or be used
> in an aggregate function) a
On Sun, 4 Dec 2005, Joost Kraaijeveld wrote:
> Hi Stephan,
>
> On Sun, 2005-12-04 at 13:33 -0800, Stephan Szabo wrote:
> > > SELECT COUNT(customers.objectid) FROM prototype.customers,
> > > prototype.addresses
> > > WHERE
> > > customers.
On Thu, 26 Jan 2006, Markus Schaber wrote:
> AFAIK, in PostgreSQL normal SQL commands cannot create deadlocks at all,
> the only way to introduce deadlocks is to issue LOCK commands to take
> locks manually. And for this rare case, PostgreSQL contains a deadlock
> detection routine that will abo
On Fri, 27 Jan 2006, Kashmira Patel (kupatel) wrote:
> Both concerns.
> 1) There are actually more than two columns with such checks, and each
> one calls a few functions which execute some more queries. So I would
> like to invoke these checks only when necessary.
> 2) The bigger concern is the
On Wed, 1 Feb 2006 [EMAIL PROTECTED] wrote:
> Hi,
>
> I user PostgreSQl 8.0.4 on Win2003 Server and write a function to copy rows
> from one table into another table with the same column definition.
> My first approach was to use something like:
>
> query_value := 'INSERT INTO ' || tabledest ||
On Sun, 12 Feb 2006, Foster, Stephen wrote:
> This is going to be one of those stupid problems of mine. I have an
> insert trigger setup to verify that duplicate or repeating information
> isn't storage in the table. If trigger function finds the information
> as a duplicate it returns a NULL a
On Wed, 15 Feb 2006, Owen Jacobson wrote:
> Maciej Piekielniak wrote:
> >
> > Wednesday, February 15, 2006, 8:31:17 PM, you wrote:
> > OJ> Note that prior to 8.0 PostgreSQL does not support
> > multiple ALTER actions in a single query. To get an
> > equivalent effect, wrap separate ALTER TABLE qu
On Sat, 18 Feb 2006, Tom Lane wrote:
> "Milen A. Radev" <[EMAIL PROTECTED]> writes:
> > Milorad Poluga :
> >>> SELECT '10 years 1 mons 1 days'::interval - '9 years 10 mons 15
> >>> days'::interval
> >>> ?column?
> >>> ---
> >>> 3 mons -14 days
> >>>
> >>> Why not '2 mons
On Sun, 19 Feb 2006, Henry Ortega wrote:
> I was able to find a suitable 7.3.2 plpgsql.so and now plpgsql works.
> (supposedly)
>
> I am trying out some really basic function creation such as this:
>
> create function dng2(start_date DATE) returns setof date as $$
> declare
> aa date:=start_date;
On Sat, 25 Feb 2006, Achilleus Mantzios wrote:
> O Owen Jacobson ?? Feb 24, 2006 :
>
> > Achilleus Mantzios wrote:
> >
> > > O Tom Lane ?? Feb 24, 2006 :
> > >
> > > > By definition, an AFTER trigger is too late to change what was
> > > > stored. Use a BEFORE trigger.
> > >
> > >
On Thu, 23 Feb 2006, Daniel Joo wrote:
> I am trying to add another primary key to an existing table with two
> other primary keys. I got the following error when I tried this
> command:
You only can have one primary key. The table you gave has a single
primary key with two columns. Are you tr
On Wed, 1 Mar 2006, Simon Kinsella wrote:
> Hi all,
>
> I have a situation where a DELETE operation may (correctly) fail due to a
> RESTRICT FK constraint. If so, I need to set a flag in the row indicating
> that it has been marked for deletion so that I can disregarded in subsequent
> queries.
>
On Wed, 1 Mar 2006, Hannu Krosing wrote:
> Ühel kenal päeval, K, 2006-03-01 kell 15:18, kirjutas Bruce Momjian:
> > Stephan Szabo wrote:
> > > > justify_days doesn't currently do anything with this result --- it
> > > > thinks its charter is only to red
On Sun, 5 Mar 2006 [EMAIL PROTECTED] wrote:
> On Sun, Mar 05, 2006 at 01:16:40PM -0500, Tom Lane wrote:
> > [EMAIL PROTECTED] writes:
> > That would work fine if you said RETURNS SETOF ltree.
> >
> > That should work too, except that you are trying to return a record
> > not an ltree value. Try "
On Sun, 5 Mar 2006 [EMAIL PROTECTED] wrote:
> On Sun, Mar 05, 2006 at 11:38:46AM -0800, Stephan Szabo wrote:
> > > But imagine instead that this function is more generic. You know
> > > that you're trying to get something that's equal to x and equal to
> &g
On Tue, 21 Mar 2006 [EMAIL PROTECTED] wrote:
> I've got 2 tables, "url" (U), and "bookmark" (B), with "bookmark" pointing to
> "url" via FK.
That's not what your schema below has. Your fragment below has URL
pointing to bookmark.
> Somehow I ended up with some rows in B referencing non-existen
On Tue, 21 Mar 2006 [EMAIL PROTECTED] wrote:
> I mistakenly swapped the tables in my email. Here they are, corrected:
>
> Table "url":
> id SERIAL
> CONSTRAINT pk_url_id PRIMARY KEY
>
> Table "bookmark":
> url_id INTEGER
>
On Tue, 21 Mar 2006, Davidson, Robert wrote:
> No matter how I try to concatenate, I can't seem to get a parameter to be
> used by INTERVAL in a function:
>
> CREATE OR REPLACE FUNCTION Testing(TrailingWeeks int) RETURNS date AS $$
> BEGIN
> RETURN current_date - INTERVAL (CAST(TrailingWeek
On Fri, 24 Mar 2006, Julie Robinson wrote:
> This works, but is there a better solution?
>
> select *
> from quality_control_reset T
> where date = (
> select max(date)
> from quality_control_reset
> where qualitycontrolrange = T.qualitycontrolrange);
If you can use PostgreSQL extens
On Mon, 27 Mar 2006, Markus Schaber wrote:
> Hi, John,
>
> John DeSoi wrote:
>
> > With SRFs, you need to specify what you want to select. In other words
> > if you are calling generate_x(bar) you need "select * from
> > generate_x(bar)" -- "select generate_x(bar)" will not work.
>
> So, then, wh
On Wed, 29 Mar 2006, Hrishikesh Deshmukh wrote:
> HI All,
>
> I have 5 tables which have different columns as shown below, each table has
> a different case column,
> i want to retrieve sample related information as follows:
>
> pid | xindex | yindex | height Index | flag | case1 | case 2.etc
On Fri, 31 Mar 2006, Eugene E. wrote:
> Peter Eisentraut wrote:
> > Eugene E. wrote:
> >
> >>the problem is: you'll get this four byte sequence '\000' _instead_
> >>of NUL-byte anyway.
> >
> >
> > What you seem to be missing is that PostgreSQL data can be represented
> > in textual and in binary f
On Tue, 4 Apr 2006, Eugene E. wrote:
> Stephan Szabo wrote:
> > On Fri, 31 Mar 2006, Eugene E. wrote:
> >
> >
> >>Peter Eisentraut wrote:
> >>
> >>>Eugene E. wrote:
> >>>
> >>>
> >>>>th
On Wed, 5 Apr 2006, Eugene E. wrote:
> Stephan Szabo wrote:
> > On Tue, 4 Apr 2006, Eugene E. wrote:
> >
> >
> >>Stephan Szabo wrote:
> >>
> >>>On Fri, 31 Mar 2006, Eugene E. wrote:
> >>>
> >>&g
On Thu, 6 Apr 2006, Eugene E. wrote:
> Stephan Szabo wrote:
> > On Wed, 5 Apr 2006, Eugene E. wrote:
> >
> >
> >>Stephan Szabo wrote:
> >>
> >>>On Tue, 4 Apr 2006, Eugene E. wrote:
> >>>
> >>>
> >>&g
r values, I don't see how that's relevant until you've proven the
rest of the argument (*).
> Stephan Szabo wrote:
>
> > What would you expect it to do given a single result format argument?
> >
> > If you want to propose a new function (set of functions) tha
On Thu, 6 Apr 2006, Stephan Szabo wrote:
> On Thu, 6 Apr 2006, Eugene E. wrote:
>
> If you meant that you must retrieve them in a separate query, you're
> incorrect, since you *could* use the binary form for the others. I can't
> understand if you don't realize t
On Thu, 6 Apr 2006, Eugene E. wrote:
> Stephan Szabo wrote:
> >>>What would you expect it to do given a single result format argument?
> >>>
> >>>If you want to propose a new function (set of functions) that have
> >>>different behavior, make
On Wed, 12 Apr 2006, George Young wrote:
> [PostgreSQL 8.1.3 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.0.1]
>
> I'm starting to use lots of foreign key constraints to keep my
> data clean. In one case, however, I need to allow null values
> for the key. E.g.:
>
> create table opset_steps
On Fri, 28 Apr 2006, Emils wrote:
> I am trying to do simple self-joins.
>
> The table structure is:
>
> object_values
> ==
> obj_id
> att_id
> value
>
> namely, each object can have arbitrary number of attributes each of
> them with a value.
>
> What I want, is a simple table of objects w
On Thu, 4 May 2006, Ash Grove wrote:
> Hi,
>
> Does beginning a transaction put locks on the tables
> queried within the transaction?
>
> In the example below, is #2 necessary? My thought was
> that I would need to use an explicit lock to make sure
> that the sequence value I'm selecting in #4 is
On Sat, 6 May 2006, kernel.alert kernel.alert wrote:
> I create the follow tables...
>
>
>
> CREATE TABLE empresa (
> id_empresa integer NOT NULL primary key,
> nombre varchar(45),
> );
> CREATE TABLE casino (
> i
On Fri, 19 May 2006, Kaloyan Iliev wrote:
> Hi Friends,
>
> I am trying to postpone the foreign key constraint check till the end of
> transaction but it doesn't work.
> Can anyone help me with a tip what I am doing wrong.
Was the constraint created as deferrable (which is not the default)?
ALL D
On Fri, 7 Jul 2006, Michael Glaesemann wrote:
>
> On Jul 7, 2006, at 7:55 , Weber, Johann (ISS Kassel) wrote:
>
> > My concern: in a multi threaded environment, can a second thread
> > interrupt this statement and eventually insert the same email
> > address in
> > the table with a different id?
On Thu, 20 Jul 2006, Hilary Forbes wrote:
> Dear All
>
> We are running pg v 7.4.1 and importantly the database has been
> converted from earlier versions of pg (6.5 I seem to recall).
>
> I have an existing table suppliers and I have created a new user 'hilary'
>
> REVOKE ALL on TABLE suppliers F
On Thu, 20 Jul 2006, Kevin Nikiforuk wrote:
> Sorry if this is in the archives, but I've done a search and couldn't
> find anything relevant. I'm running HP's precompiled version of 8.1.3.1
> as part of their Internet Express offering, and I can't seem to run a
> for loop. Here's what I'm seeing:
On Fri, 21 Jul 2006, Kevin Nikiforuk wrote:
> Many thanks to Stephan, Richard and George. When I was reading the
> documentation about FOR loops, I didn't realize that I was in the plpgsql
> section!
>
> CREATE OR REPLACE FUNCTION rgio() RETURNS integer as $$
> BEGIN
> DECLARE lv RECORD
On Mon, 24 Jul 2006, Kevin Nikiforuk wrote:
> So, I've changed my code as Erik suggested:
>
> CREATE OR REPLACE FUNCTION rgio() RETURNS INTEGER as $$
> DECLARE
> lv RECORD;
>
> BEGIN
> FOR lv IN SELECT DISTINCT rg
> FROM ldevrg
> LOOP
>
>
On Sat, 10 Oct 2009, [utf-8] Dag-Erling Sm??rgrav wrote:
> Consider the attached schema (filmstars.sql), which is a poorly designed
> database of films and actors. The following query gives me a list of
> films in which either Charlie or Martin Sheen starred:
>
> select fs.film.title, fs.film.yea
On Sat, 10 Oct 2009, [utf-8] Dag-Erling Sm??rgrav wrote:
> Stephan Szabo writes:
> > Not at all tested as I don't have access to my db right now, but I think
> > something like one of these would work:
> >
> > select fs.film.title, fs.film.year
> > from f
On Tue, 22 Aug 2006, Brian Cox wrote:
> Given a view like:
>
> create view view1 as
> select g.id as UserGroupId, s.uid as UserId, s.time as StartTime from stats
> s join groups g on g.uid = s.uid
>
> and a SELECT like:
>
> select a.UserGroupId,b.UserGroupId from view1 a
> full outer join vi
On Fri, 1 Sep 2006, Walter Cruz wrote:
> Hi all. I'm with a little doubt.
>
> I'm testing the pagila (the postgres port of mysql sakila sample).
>
> Well, I was trying to translate the query:
>
> select
> film.film_id AS FID,
> film.title AS title,
> film.description AS description
On Thu, 7 Sep 2006, Kaloyan Iliev wrote:
> Hi All,
> I have a query in which I want to SELECT FOR UPDATE same rows but only
> from one table.
> Firs I try just with SELECT FOR UPDATE but I receive an error
> because of the LEFT JOIN - "ERROR: SELECT FOR UPDATE/SHARE cannot be
> applied to the nu
On Thu, 7 Sep 2006, Emi Lu wrote:
> Hello,
>
> Is it possible to do something like:
>
> select ...
> from t1
> inner join t2 ...
> left join t2.colN
>
> When t1 inner join with t2 I got unique result for t2.colN( colN's value
> is table name).
>
> Can I continue to left join with the column "colN"
On Fri, 6 Oct 2006, Jean-Paul Argudo wrote:
> Hi all,
>
> > Where did you get that idea? age's reference point is current_date (ie,
> > midnight) not now(). There are also some differences in the calculation
> > compared to a plain timestamp subtraction.
>
> I'm jumping on this thread to point o
On Mon, 23 Oct 2006, Luca Ferrari wrote:
> Hi all,
> I guess this is an already asked question, but I didn't found an answer, so
> apologize me. Imagine I've got two tables:
> skill(id,description) // primary key => id
> family(id,description)// primary key => id
> and I want to a
On Tue, 31 Oct 2006, Chuck McDevitt wrote:
> We treated quoted identifiers as case-specific, as the spec requires.
>
> In the catalog, we stored TWO columns... The column name with case
> converted as appropriate (as PostgreSQL already does), used for looking
> up the attribute,
> And a second col
On Wed, 29 Nov 2006, James Robinson wrote:
> I see that subselects are not directly supported in check clauses,
> but one can work around that by writing a stored function which
> returns boolean and performs the subselect. Are there any known
> gotchas with doing this?
To completely get the con
On Wed, 29 Nov 2006, Ehab Galal wrote:
> I have three tables t1(a, b, c, d), t2(a, b, c, k), and t3(c, e). I need to
> outer join them as shown below, but only have all tuples from t1 as output.
> But the following syntax does not allow me to do so.
>
> SELECT t1.*
> FROM (t1 outer join t2 on (t1.
601 - 700 of 732 matches
Mail list logo