Re: [GENERAL] SELECT statement with sub-queries
On 28.05.2017 20:19, m...@ft-c.de wrote: Hallo, SELECT * FROM products WHERE exists (SELECT categories.cat FROM categories WHERE categories.serial==products.category); categories.serial = products.category); -- one equal sign or SELECT * FROM products WHERE category IN (SELECT categories.cat FROM categories); On 28.05.2017 19:03, Michelle Konzack wrote: Hello *, I try to get columns from my database with a singel SELECT, but I stuck. I have 3 tables like: 1) categories (serial,cat) 2) manufacturers (serial,m_name) 3) products (serial,category,manufacturer,p_name) where the "category" and "manufacturer" are numerical IDs from the two tables above. So I like to replace the numerical IDs with the appropriated values, mean SELECT * FROM products WHERE category IN (SELECT categories.cat FROM categories WHERE categories.serial==products.category); But I get: ERROR: operator does not exist: integer==integer LINE1: ...gories.cat FROM categories WHERE categories.serial==products.category); ^ Hmm, "serial" is an "integer" and the "category" and "manufacturer" too. So whats wrong with it? -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
Re: [GENERAL] SELECT statement with sub-queries
Hallo, SELECT * FROM products WHERE exists (SELECT categories.cat FROM categories WHERE categories.serial==products.category); or SELECT * FROM products WHERE category IN (SELECT categories.cat FROM categories); On 28.05.2017 19:03, Michelle Konzack wrote: Hello *, I try to get columns from my database with a singel SELECT, but I stuck. I have 3 tables like: 1) categories (serial,cat) 2) manufacturers (serial,m_name) 3) products (serial,category,manufacturer,p_name) where the "category" and "manufacturer" are numerical IDs from the two tables above. So I like to replace the numerical IDs with the appropriated values, mean SELECT * FROM products WHERE category IN (SELECT categories.cat FROM categories WHERE categories.serial==products.category); But I get: ERROR: operator does not exist: integer==integer LINE1: ...gories.cat FROM categories WHERE categories.serial==products.category); ^ Hmm, "serial" is an "integer" and the "category" and "manufacturer" too. So whats wrong with it? -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
[GENERAL] tsearch2 memory problem
Hi! I realized that loading a dictionary with ~16 words consumes additional ~40 MB of memory for each connection. It obviously doesn't use a shared memory. Is it possible to decrease the memory consumption? I found this thread http://www.mail-archive.com/pgsql-general@postgresql.org/msg116924.html but no solution. Is there any progress in this area? Thanks. David -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
[GENERAL] Re: [HACKERS] Re: pg_dump with BLOBS & V7.0.2 UPDATED
From: [EMAIL PROTECTED] (Pavel Janík ml.) Date: Wed, 19 Jul 2000 11:11:05 +0200 Hi, > this patch applied, just untar the newest snapshot to src/bin/pg_dump > and you can continue with normal installation: configure && make && > make install. hmm. PG_VERSION is defined as 0 in version.h: #define PG_VERSION "0" but in CVS version the variable is defined in config.h: #define PG_VERSION "7.1devel" So if you compile the new pg_dump as I wrote above, you must use --ignore-version: SnowWhite:/home/pavel$ pg_dump db Database version: Archiver(db) PostgreSQL 7.0.2 on i486-pc-linux-gnu, compiled by gcc 2.7.2.3 version: 0 Aborting because of version mismatch. Use --ignore-version if you think it's safe to proceed anyway. SnowWhite:/home/pavel$ I think this is the correct (and smallest :-) patch: diff -u pg_dump_141.orig/pg_backup_db.c pg_dump_141/pg_backup_db.c --- pg_dump_141.orig/pg_backup_db.c Sun Jul 16 12:30:08 2000 +++ pg_dump_141/pg_backup_db.c Wed Jul 19 12:43:09 2000 @@ -101,7 +101,7 @@ double remoteversion; PGconn *conn = AH->connection; - myversion = strtod(PG_VERSION, NULL); + myversion = strtod(PG_VERSION_STR + 11, NULL); res = PQexec(conn, "SELECT version()"); if (!res || PQresultStatus(res) != PGRES_TUPLES_OK || -- Pavel Janík ml. [EMAIL PROTECTED]
[GENERAL] Re: pg_dump with BLOBS & V7.0.2 UPDATED
From: Philip Warner <[EMAIL PROTECTED]> Date: Sun, 16 Jul 2000 20:49:35 +1000 Hi Philip, > Another update of the dump code; this fixes a few bugs that people without > zlib under 7.02 would have experienced. Also, if you wish to use zlib, you > need to modify the Makefile to add -DHAVE_LIBZ to the CFLAGS please apply attached patch for 7.0.2 version. It is long, but it only removes Makefile and creates Makefile.in which can be used for 7.0.2. With this patch applied, just untar the newest snapshot to src/bin/pg_dump and you can continue with normal installation: configure && make && make install. Thank you for good work. -- Pavel Janík ml. [EMAIL PROTECTED] diff -uN pg_dump_141.orig/Makefile pg_dump_141/Makefile --- pg_dump_141.orig/Makefile Wed Jul 19 10:53:31 2000 +++ pg_dump_141/Makefile Thu Jan 1 01:00:00 1970 @@ -1,64 +0,0 @@ -#- -# -# Makefile for src/bin/pg_dump -# -# Copyright (c) 1994, Regents of the University of California -# -# $Header: /home/projects/pgsql/cvsroot/pgsql/src/bin/pg_dump/Makefile,v 1.19 2000/07/04 19:52:00 petere Exp $ -# -#- - -subdir = src/bin/pg_dump -top_builddir = ../../.. - -SRCDIR= ../.. -include ../../Makefile.global - -OBJS= pg_backup_archiver.o pg_backup_db.o pg_backup_custom.o pg_backup_files.o \ - pg_backup_null.o pg_backup_tar.o $(STRDUP) - -CFLAGS+= -I$(LIBPQDIR) -LIBS+= -lz - -all: submake pg_dump pg_restore pg_dumpall - -pg_dump: pg_dump.o common.o $(OBJS) $(LIBPQDIR)/libpq.a - $(CC) $(CFLAGS) -o $@ pg_dump.o common.o $(OBJS) $(LIBPQ) $(LDFLAGS) - -pg_restore: pg_restore.o $(OBJS) $(LIBPQDIR)/libpq.a - $(CC) $(CFLAGS) -o $@ pg_restore.o $(OBJS) $(LIBPQ) $(LDFLAGS) - -../../utils/strdup.o: - $(MAKE) -C ../../utils strdup.o - -pg_dumpall: pg_dumpall.sh - sed -e 's:__VERSION__:$(VERSION):g' \ - -e 's:__MULTIBYTE__:$(MULTIBYTE):g' \ - -e 's:__bindir__:$(bindir):g' \ - < $< > $@ - -.PHONY: submake -submake: - $(MAKE) -C $(LIBPQDIR) all - -install: all installdirs - $(INSTALL_PROGRAM) pg_dump$(X) $(bindir)/pg_dump$(X) - $(INSTALL_PROGRAM) pg_restore$(X) $(bindir)/pg_restore$(X) - $(INSTALL_SCRIPT) pg_dumpall $(bindir)/pg_dumpall - $(INSTALL_SCRIPT) pg_upgrade $(bindir)/pg_upgrade - -installdirs: - $(mkinstalldirs) $(bindir) - -uninstall: - rm -f $(addprefix $(bindir)/, pg_dump$(X) pg_restore$(X) pg_dumpall pg_upgrade) - -depend dep: - $(CC) -MM $(CFLAGS) *.c >depend - -clean distclean maintainer-clean: - rm -f pg_dump$(X) pg_restore$(X) $(OBJS) pg_dump.o common.o pg_restore.o pg_dumpall - -ifeq (depend,$(wildcard depend)) -include depend -endif diff -uN pg_dump_141.orig/Makefile.in pg_dump_141/Makefile.in --- pg_dump_141.orig/Makefile.in Thu Jan 1 01:00:00 1970 +++ pg_dump_141/Makefile.in Wed Jul 19 10:45:08 2000 @@ -0,0 +1,55 @@ +#- +# +# Makefile for src/bin/pg_dump +# +# Copyright (c) 1994, Regents of the University of California +# +# $Header: /home/projects/pgsql/cvsroot/pgsql/src/bin/pg_dump/Makefile,v 1.19 2000/07/04 19:52:00 petere Exp $ +# +#- + +SRCDIR= ../.. +include ../../Makefile.global + +OBJS= pg_backup_archiver.o pg_backup_db.o pg_backup_custom.o pg_backup_files.o \ + pg_backup_null.o pg_backup_tar.o @STRDUP@ + +CFLAGS+= -I$(LIBPQDIR) +LIBS+= -lz + +all: submake pg_dump pg_restore pg_dumpall + +pg_dump: pg_dump.o common.o $(OBJS) $(LIBPQDIR)/libpq.a + $(CC) $(CFLAGS) -o $@ pg_dump.o common.o $(OBJS) $(LIBPQ) $(LDFLAGS) + +pg_restore: pg_restore.o $(OBJS) $(LIBPQDIR)/libpq.a + $(CC) $(CFLAGS) -o $@ pg_restore.o $(OBJS) $(LIBPQ) $(LDFLAGS) + +../../utils/strdup.o: + $(MAKE) -C ../../utils strdup.o + +pg_dumpall: pg_dumpall.sh + sed -e 's:__VERSION__:$(VERSION):g' \ + -e 's:__MULTIBYTE__:$(MULTIBYTE):g' \ + -e 's:__bindir__:$(bindir):g' \ + < $< > $@ + +.PHONY: submake +submake: + $(MAKE) -C $(LIBPQDIR) all + +install: all + $(INSTALL) $(INSTL_EXE_OPTS) pg_dump$(X) $(BINDIR)/pg_dump$(X) + $(INSTALL) $(INSTL_EXE_OPTS) pg_restore$(X) $(BINDIR)/pg_restore$(X) + $(INSTALL) $(INSTL_EXE_OPTS) pg_dumpall $(BINDIR)/pg_dumpall + $(INSTALL) $(INSTL_EXE_OPTS) pg_upgrade $(BINDIR)/pg_upgrade + +depend dep: + $(CC) -MM $(CFLAGS) *.c >depend + +clean: + rm -f pg_dump$(X) pg_restore$(X) $(OBJS) pg_dump.o common.o pg_restore.o pg_dumpall + +ifeq (depend,$(wildcard depend)) +include depend +endif