|
pgAdminIII restore database issue
|
| |
Hi, I would like to modify by hand plain text dump of database (in SQL). I've done all changes and now my intention is to use pgAdminIII to restore database. I found in documentation that TAR files are supported so I packed my sql script using Total Commander. Unfortunatelly button OK in restore... more »
|
|
Postgres CIDR/INET management - any useful functions?
|
| |
Hello group, again I am stuck with a different problem. Let's say I have given a subnet '10.4.0.0/16'::cidr and a list of hosts hosts -------------- 10.4.5.12 10.4.5.13 10.4.5.14 Is there a funciton/select query to yield all ip addresses in the CIDR subnet except for the "hosts"? Something like SELECT * FROM '10.4.0.0/15'::cidr AS ip WHERE NOT ip IN (SELECT ip FROM... more »
|
|
Trigger problem
|
| |
Hello group, I'm playing around with triggers. What I want to achieve is a table of subnets. All subnets should be disjoint, network is of type cidr. E.g. The following should not be possible: INSERT INTO subnets (network) VALUES ('192.168.1.0/24'); INSERT INTO subnets (network) VALUES ('192.168.0.0/16');... more »
|
|
Multiple SELECTs cached by Postgres?
|
| |
Hello group, I've a performance question about Postgres. Say I have two queries which are complex and require lots of time (many joins, etc). For my example, I'll just use the simple: SELECT a FROM b [many joins etcetc]; Now when I want to know how many rows were returned, I'll issue: SELECT COUNT(*) FROM b [many joins etcetc];... more »
|
|
Backup and restore, manual rearrange
|
| |
Hello group, I just found something extremely annoying: I backup my DB with pg_dump to extract the data. Then I drop the schema public in the backupped database and restore it (a little bit modified, but compatible with the backupped data). As third step I try to restore the data my doing a psql... more »
|
|
Create VIEW readability
|
| |
Hello group, for purposes of better readability I tried to avoid subqueries (which tend to become quite obfuscating at the 4th or 5th level of indention). Therefore I tried the following, which is well readable: CREATE TEMPORARY VIEW pxe1 AS SELECT hosts.ip AS clientip, dhcppxe.filename AS pxefilename,... more »
|
|
implementing the rules of business within the database
|
| |
Guys! is it better to implement the business logic within the database? i.e. through functions, triggers, constraints .. etc or implement the logic within the application? does implementing the logic within the db violates the MVC principle?
|
|
ORDER BY in UNION in postgres 7.3.9
|
| |
"SELECT a.*, m.mailbox_name FROM addresses a, mailboxes m, link_mailbox_addresses lma " + "WHERE NOT temp_address AND NOT delete AND a.address_ref > 0 AND protocol <> ? " + "AND a.address_ref = lma.address_ref AND lma.mailbox_ref = m.mailbox_ref " + "UNION SELECT *, '' FROM addresses WHERE address_ref NOT IN "... more »
|
|
|